0

My problem is I want to add this to blogger inside the head but I get an error that say:

Erreur d'analyse XML, ligne 1060, colonne 20 : The content of elements must consist of well-formed character data or markup..

/* When the user clicks on the button, 
toggle between hiding and showing the dropdown content */
function myFunction() {
document.getElementById("myDropdown").classList.toggle("show");
}

// Close the dropdown menu if the user clicks outside of it
window.onclick = function(event) {
if (!event.target.matches('.dropbtn')) {

var dropdowns = document.getElementsByClassName("dropdown-content");
var i;
for (i = 0; i < dropdowns.length; i++) {
  var openDropdown = dropdowns[i];
  if (openDropdown.classList.contains('show')) {
    openDropdown.classList.remove('show');
  }
}
}
}
Cœur
  • 37,241
  • 25
  • 195
  • 267
Chams Agouni
  • 87
  • 11
  • 1
    Possible duplicate of [Error parsing XHTML: The content of elements must consist of well-formed character data or markup](https://stackoverflow.com/questions/4338538/error-parsing-xhtml-the-content-of-elements-must-consist-of-well-formed-charact) –  Dec 16 '17 at 16:40

1 Answers1

0

see here: Error parsing XHTML: The content of elements must consist of well-formed character data or markup

you may not use a < inside inline scripts because the parser thinks of it to be a tag beginning.