This is a migrated thread and some comments may be shown as answers.

Button only on initial load updating value

1 Answer 40 Views
AppBuilder in-browser client
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jonas
Top achievements
Rank 1
Jonas asked on 23 Apr 2013, 11:23 AM
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!

1 Answer, 1 is accepted

Sort by
0
David Silveria
Top achievements
Rank 1
answered on 23 Apr 2013, 11:48 AM
Does this code work from a regular browser on your desktop? Where is it invoked, do you use deviceready event?

Tags
AppBuilder in-browser client
Asked by
Jonas
Top achievements
Rank 1
Answers by
David Silveria
Top achievements
Rank 1
Share this question
or