Internet Explorer unknown runtime error with element.innerHTML

Don't use element.innerHTML to add HTML string to an element. It will cause Unknown Runtime Error from Internet Explorer. However, other browsers(e.g. Firefox, Chrome) don't complain about that and work properly. Instead, use the following function to create the complete structure:

  • document.createElement()
  • document.createTextNode()
  • element.appendChild()