This question is locked. New answers and comments are not allowed.
Hi,
I'm trying to change the value of a button based on JS. Essentially, every time I load the page the values should change. My code is:
if (correctOption == 3)
document.getElementById('option3').value = num1 + num2;
else
document.getElementById('option3').value = Math.floor((Math.random()*200)+1);
For the initial run everything looks fine but during subsequent runs the value does not update. Any idea what I'm doing wrong? (I'd rather not use jQuery at this point to reduce overhead). Thanks!
I'm trying to change the value of a button based on JS. Essentially, every time I load the page the values should change. My code is:
if (correctOption == 3)
document.getElementById('option3').value = num1 + num2;
else
document.getElementById('option3').value = Math.floor((Math.random()*200)+1);
For the initial run everything looks fine but during subsequent runs the value does not update. Any idea what I'm doing wrong? (I'd rather not use jQuery at this point to reduce overhead). Thanks!