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

224
Views
Can't get text appearing with javascript .appendChild

This is the append function I'm using

function append(parent, el) {
  return parent.appendChild(el);
}

And this is where it's being used

let container = document.getElementById("container");
let line = createNode("p");
let line2 = createNode("p");
let line3 = createNode("p");
line.innerHTML = data[key][0];
line2.innerHTML = data[key][1];
//this line checks if there is a third type to be displayed
if (typeof data[key][2] !== "undefined") {
  line3.innerHTML = data[key][2];
}
append(container, line);
append(container, line2);
append(container, line3);

The console error always comes back as Cannot read properties of null (reading 'appendChild') Which part of the appendChild is null?

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!