We use jQuery to parse some HTML. I then need to traverse that document and find some elements. Among the elements I need to find, there are the el
jQuery can't do it, but your browser can: (Do not try to parse HTML with a regex as someome suggested.)
txt = 'ajelo';
if(window.DOMParser) {
parser=new DOMParser();
xmlDoc=parser.parseFromString(txt,"text/xml");
} else { // Internet Explorer
xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async="false";
xmlDoc.loadXML(txt);
}
xmlDoc.getElementsByTagName('LINK');
Be aware that XML is case sensitive, so you need to search for 'LINK' using the same case as it is in the HTML.