I’m having some troubles with my JS code. I have created a drop-down list with JS and a button next to it to get the selected value from the drop-down list and use it for a calculation.
However, when clicking on the button, for some reason the text of the selected option cannot be read.
Code below
for (let i = 0; i < neededDays - 1; i++){
let selectBreak = document.createElement("SELECT");
selectBreak.id = "selectBreak" + i;
document.getElementById("eta").appendChild(selectBreak);
let arrayBreakOptions = ["9", "11", "24", "45"];
for (let j = 0; j <arrayBreakOptions.length; j++){
let option = document.createElement("OPTION");
option.value = arrayBreakOptions[j];
option.text = arrayBreakOptions[j];
if (option.value == 11){
option.setAttribute("selected", "selected");
}
document.getElementById("selectBreak" + i).appendChild(option);
let btnChangeBreakHours = document.createElement("BUTTON");
btnChangeBreakHours.id = "btnChangeBreakHours";
btnChangeBreakHours.innerHTML = "Recalculate";
btnChangeBreakHours.setAttribute("type", "button");
document.getElementById("eta").appendChild(btnChangeBreakHours);
document.getElementById("eta").appendChild(document.createElement("BR"));
let minutesDayBreak = 0;
btnChangeBreakHours.onclick = function changeBreakHours(){
let sel = document.getElementById("selectBreak" + i);
let selectedValueBreak = sel.options[sel.selectedIndex].text;
minutesDayBreak = selectedValueBreak * 60;
}
}
I found similiar problems to mine but the issue with them was that there were typos in the code. I already checked mine and it seems to me that there are no typos.
The error is
TypeError: Cannot read property ‘options’ of null at HTMLButtonElement.changeBreakHours
Do you have any tips and suggestions what I am missing?
http://cialisbob.com/ cialis tadalafil 5mg
http://kamagraday.com/ meet mychelle kamagra
https://himscanada.com/ printable cialis coupon
https://levitradd.com/ cialis v viagra v levitra
http://albuterolinh.com albuterol sulfate inhalation solution price
https://viagraxyu.com canadian viagra
viagra tablet price online – canadian discount pharmacy viagra buy sildenafil tablets
http://ivermectineffects.com ivermectin
reputable canadian pharmacy – best price generic cialis 20 mg brand name cialis canada
how are hypertension, heart disease, and stroke related help me find a doctor
stromectol 3 mg tablets price https://ivermectinhome.com
cost of ivermectin cream – ivermectin drug stromectol pill for humans
online casino gambling – hollywood casino online ocean casino online
levitra http://levitrair.com levitra tablets
erectile dysfunction pills over the counter – erectile dysfunction treatment cheap erectile dysfunction
can you buy prednisone online – prednisone purchase online deltasone without script online in mexico
ivermectin for humans dosage http://stromectolus.com ivermectin for humans where to buy locally near me
price for 100mg viagra – viagra without a prescription best prices for viagra in canada
obama care health insurance number of hiv cases in tippecanz
ivermectin tablets for humans https://ivermectinhome.com
buy cialis online visa – Generic cialis generic cialis 10mg online
buy oral stromectol – stromectol coronavirus buy ivermectin for humans australia
charlie murphy hiv positive united health com
stromectol https://ivermectinhome.com
erectile dysfunction medicines – buy ed pills online erectile dysfunction treatment over the counter
javascript-help.li reviewed best canadian online pharmacies certified https://pharmvolk.com best canadian pharmacies online prescriptions
family doctor requirements physicians primary care
ivermectin tablets dosage https://ivermectinhome.com
javascript-help.li reviewed where to buy ivermectin in phoenix https://ivermectini.com buy stromectol
warrick county health department http://doctorkiva.com viagra 100mg
javascript-help.li recommended buy stromectol https://ivermectiny.com ivermectina en humanos
sildenafil over the counter – viagra online canada average price of 100mg viagra
health care services http://sildenafilhim.com sildenafil
cialis 5mg price uk – cheap generic cialis from india
american health care reform ivermectin https://iveramectin.com ivermectin for humans walmart
generic vardenafil 40 mg – generic vardenafil vs vardenafil for sale online
javascript-help.li and where to buy ivermectin http://ivermectiny.com stromectol
under what experimental conditions will smoking show a relationship with asthma in an adult http://kamagraxy.com kamagra jelly
60 mg prednisone daily – 20mg daily prednisone prednisone tabs 20 mg
javascript-help.li reviewed doctors who prescribe ivermectin at no cost https://ivermectinhum.com stromectol 12 mg
amoxicillin for sinus infection – generic amoxicillin cost buy amoxicilin 500
frusemide 20mg furosemide 10 mg nek nox
furosemide 80 mg furosemide 40 mg nek nox
stromectol nz – ivermectin medicine stromectol in canada
deltasone – prednisone 40 mg price prednisone 5mg price
buy cialis black http://himscanada.com real cialis without a doctor’s prescription Cannot read property ‘options’ of null JS – JavaScript Help
javascript-help.li vs ivermectin horse paste for humans http://ivermectiny.com ivermectina para que serve
ventolin hfa inhaler – albuterol without prescription ventolin cost australia
stromectol 3mg cost cost of ivermectin 1% cream
ivermectin canada stromectol nz
zithromax https://azithrozpack.com zithromax
buy clomid online next day delivery nek nox
clomid ebay nek nox
http://ivrmectin.com – ivermectin uk
amoxicillin chlamydia male
zirtec – http://allergyd.com
liquid ivermectin stromectol prescription
std in men signs and symptoms http://dapoxetineus.com – dapoxetine medicine price in india
ivermectin tablets ivermectin generic
buy vardenafil with paypal – generic vardenafil online where to buy otc ed pills
buy propecia chemist warehouse
genuine cialis canada
where to order cialis in canada
buy zithromax mastercard
ivermectin pills http://www.ivermecton.com/ canine ivermectin for sale
where to buy sildenafil over the counter https://www.viagwdp.com/# best price on viagra canada online pharmacy
https://www.sildenafilhim.com diabetes erectile dysfunction natural remedies
buy clomid
buy sildenafil with paypal https://www.viagwdp.com/ cheap viagra online uk viagra sildenafil 100mg
goodrx diflucan
como tomar fluconazol de 200 mg
sildenafil 100mg tablets – cialis 5mg ca cialis for men
can amoxicillin get u high
acheter 200mg sildenafil – acheter 20mg gГ©nГ©rique tadalafil en france tadalafil 5mg generique pas cher
generic stromectol for humans – tadalafil generika ivermectin 6 mg over the counter
what’s the difference between albuterol and levalbuterol
cost lyrica 150mg – order clomid for sale zithromax 250mg cheap
tadalafil generic cialis without prescription
cenforce online buy – cost zyloprim zovirax online buy
order hydroxyzine 25mg generic – atarax 25mg ca crestor 10mg pill
where to order tadalafil tablets tadalafil side effects
https://cialisbusd.com/ tadalafil cialis
cost of cialis tadalafil drug
tadalafil online cost of cialis
cost of cialis buy tadalafil
tadalafil goodrx cialis without prescription
buy tadalis tadalafil brands
ivermectin generic
order stromectol pill ivermectin tablets from india
buy 12mg stromectol generic ivermectin 12mg
Интернет-платформа Joycasino начала
деятельность на просторах отечественного интернета
в две тысячи четырнадцатом году.
Пользователям портала предложен
топовый программный продукт от известных разработчиков.
В ассортимент цифровых развлечений входят аппараты с барабанами и линиями, лайв-игры и прогнозы на спорт и
киберспортивные дисциплины.