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

169
Views
Cannot set properties of null (setting 'textContent')

I have recently started coding.

I wanted to make a site where typing effect is reproduced.

I followed a tutorial, but opening the Chrome console I find this error: "Cannot set properties of null (setting 'textContent')"

If I try to run it on codepen it works, but if I use my text editor and run the code on Chrome it doesn't.

I also leave you the link for the code: https://codepen.io/andreab16/pen/KKQegQN

var texts = ["designer", "F1 enthusiast", "guy", "human"];

let count = 0;
let index = 0;
let currentText = "";
let letter = "";

(function type() {
  if (count === texts.length) {
    count = 0;
  }

  currentText = texts[count];

  letter = currentText.slice(0, ++index);

  document.querySelector(".typing").textContent = letter;
  console.log("ok");

  if (letter.length === currentText.length) {
    count++;
    index = 0;
  }

  setTimeout(type, 250);
})();

Thank you very much everyone

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!