Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

318
Views
onload function not working on paragraph in JavaScript

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>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!