suppose in a variable html is saved like
var vhtm="<div><div id='test'>zebra</div><div id='foo'>here is my many other html content</div></div>";
i want to parse the above html stored in variable with the help of jquery. i need to extract a particular div by id and including its content. the return result would like
<div id='foo'>here is my many other html content</div>
so i need to find div by id like id='foo'
please help me how to parse the above like jquery.
try something like this :
$(vhtml).find('#foo');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With