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

145
Views
Error in JS "Uncaught TypeError: Cannot set properties of null (setting 'innerHTML') at call.html:10:58"

I am new to JavaScript I am trying to print an array using a function document.getElementById I am getting an error Uncaught TypeError: Cannot set properties of null (setting 'innerHTML') at call.html:10:58

<!DOCTYPE html>
<html>
    <head>
        <title>My information</title>
        <body>
            <h1>My name is Luffy</h1>
            <p>I am a software developer</p>
            <script>
            const programmingLanguage = ["Python", "Java","C"];
                document.getElementById("program").innerHTML=programmingLanguage;
            </script>
        </body>
    </head>
</html>

please help me where did i go wrong

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The problem is that, you are trying to get an element which has the id program, but there is no element which has the id as program.

You can create an element with id program. this will resolve the error.

<!DOCTYPE html>
<html>
    <head>
        <title>My information</title>
        <body>
            <h1>My name is Luffy</h1>
            <p>I am a software developer</p>
            
            <p id="program"></p>
            
            <script>
            const programmingLanguage = ["Python", "Java","C"];
                document.getElementById("program").innerHTML=programmingLanguage;
            </script>
        </body>
    </head>
</html>

about 4 years ago · Juan Pablo Isaza Report
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!