Parsing of html string using jquery
None of the current answers addressed the real issue, so I’ll give it a go. var datahtml = “<html><body><div class=\”class0\”><h4>data1</h4><p class=\”class1\”>data2</p><div id=\”mydivid\”><p>data3</p></div></div></body></html>”; console.log($(datahtml)); $(datahtml) is a jQuery object containing only the div.class0 element, thus when you call .find on it, you’re actually looking for descendants of div.class0 instead of the whole HTML document that you’d … Read more