Is it possible to use a jQuery selector on an HTML string? I'm trying to get the html contents of the div, foo.
var code = "<div id='foo'>1</div><div id='bar'>2</div>";
alert( $(code).html( ) ); // returns 1 (not sure how...)
How can I get the html contents of foo and of bar in two different statements?