I have a string of html, on which i want to use jquery functions.
The string has divs as below.
var html=
<div class = foo>
some code
<div class = bar>
//more divs, code
</div>
</div>
I need to select the divs with class 'bar' out of these and use it for something. This is what I'm doing
var jqueryObj = jQuery( html);
jQuery('.bar', jqueryObj).wrap( //a new div );
but this doesnt seem to be working.
its not taking the context of jqueryObj correctly.
Any idea where I am going wrong?
jQueryObj.find('.bar')instead.