I need a reliable Javascript library / function to check if a HTML snippet is valid that I can call from my code. For example, it should check that opened tags and quotation
function isHTML(str) { var a = document.createElement('div'); a.innerHTML = str; for(var c= a.ChildNodes, i = c.length; i--) { if (c[i].nodeType == 1) return true; } return false; }
Good Luck!