Here is my code, I would like to know why does display() executes but show() doesn't. There must be a logic behind it right. Please enlighten me.
<html>
<head>
</head>
<body>
<button id="b1" onclick="show()">Show</button>
<p id="p1"></p>
<p id="p2"></p>
<body>
<script>
function show()
{
document.getElementById("p1").innerHTML="Hello";
}
document.getElementById("b1").onclick=display;
function display(){
document.getElementById("p2").innerHTML="World";
}
</script>
</html>