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

126
Views
How to fix the javascript execution error in blogger
<script>
var coll = document.getElementsByClassName("collapsible");
var i;

for (i = 0; i < coll.length; i++) {
coll[i].addEventListener("click", function() {
  this.classList.toggle("active");
  var content = this.nextElementSibling;
  if (content.style.maxHeight){
    content.style.maxHeight = null;
  } else {
    content.style.maxHeight = content.scrollHeight + "px";
  } 
});
}
</script>

When I am using this code in blogger this shows:-

"org.xml.sax.SAXParseException; lineNumber: 301; columnNumber: 16; The content of elements must consist of well-formed character data or markup. " Here is the image

Please help me how to fix this problem

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

0

Even just looking at the syntax coloring that you provided in your image, the < is giving you problems in this line, line 301:

for (i = 0; i < coll.length; i++) {

The parser is interpreting < as the start of a tag, and expects a tag name and an end tag >. However, I'm guessing you are trying to use it as the JavaScript "less than" operator.

In that case, escape < as &lt;.

In otherwords, replace that line with:

for (i = 0; i &lt; coll.length; i++) {

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!