What is wrong with below code? I've added a button. And on the button's onclick event, I'm calling the script to change the value of p tag.
In the script, I'm trying to set the value od p tag using its ID attribute.
But nothing is changing if I click on the button.
Tested in different browsers, still no result.
Here is the code:
<HTML>
<BODY>
<INPUT TYPE="BUTTON" onclick="changeValue()" VALUE="Change Value" />
<P ID="demo">Initial Value</P>
<SCRIPT>
function changeValue() {
document.getElementByID("demo").innerHTML="Value Changed"
}
</SCRIPT>
</BODY>
</HTML>