Reputation: 1129
So I have a few buttons which look like this, the other three are exactly the same but with different text and ID.
<p id="a"> Counters on A: 0 </p> <button onclick="add('a')" disabled>Add</button>
I initially have the buttons disabled, but would like to enable them after button X1 is clicked. At the end of the function that is called when X1 is clicked I add the following lines
document.getElementById("a").disabled = false;
For some reason the buttons are still disabled. And I did a few tests and the program reaches before and after the enabling of the method but that one line is not being enabled. Why is this?
Upvotes: 0
Views: 68
Reputation: 21364
<p> Counters on A: 0 </p> <button onclick="add('a')" disabled id="a">Add</button>
document.getElementById("a").disabled = false;
Upvotes: 1