0

The following JavaScript code is used to make a collapsible element but it isn't accepted on google blogger and I recieve this message: "org.xml.sax.SAXParseException; lineNumber: 847; columnNumber: 22; The content of elements must consist of well-formed character data or markup." Can anyone help me?

var coll = document.getElementsByClassName("collapsible");
var i;

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

0 Answers0