<p>Given that y=5, calculate x=y+2, and display the result.</p>
<button onclick="myFunction()">Try it</button>
demoP.innerHTML="x=" + x;
Can anybody please explain me why on the "demoP.innerHTML="x=" + x;", the function has to be written in "="x=" + x;"? I got this example from w3school, but nobody explains anything about it.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Tags for this Thread