<script> tags or in an external file and referenced with a
Correct me if I’m wrong, but as I understand it, you want the “To do now.” to change to 5.
If so then you don’t need your
do variable. You would just change your
onclick attribute value as follows:
<button type="button" onclick='document.getElementById("demo").innerHTML = "5"'>Click Here!</button>
script tag and insert a function to do so like this:
I’m not too sure why you want to do this but I gave you this option anyway incase you did.
As you can see, I changed the
do variable that you used to
doo as you can’t use the first version as a variable name. This is due to the fact that we use
do as a keyword for loops. Check out w3’s page on do/while loops here.
CLICK HERE to find out more related problems solutions.