0

So the error is the paragraph is not changing while we load the page.

Here is the code, I have added the JavaScript in the head itself. I even tried using external JavaScript too but that didn't work either. I used the onload function of JavaScript to change my inner HTML of paragraph, but it did not work.

<html>
<head>
  <script type="text/JavaScript">
    function fun_name() {
      alert("Working");
      document.getElementById("para").innerHTML = "After Loading"
    }
  </script>
</head>
<body>
  <p onload="fun_name();" id="para">Before Loading</p>
</body>
</html>

0 Answers0