Go to Comments





How to find element in html string jquery‏


Created: 25/04/2015 08:25:13 a.m.





How to find element in html string jquery‏


Use parseHTML from jquery 1.8 and above



var str = '<div id="div1">div one</div><div id="div2">div two</div>';
var html = $.parseHTML(str);
alert($(html).filter('#div1').text());

 









Comments: