Given this html string:
var string = \"\";
I create a jQuery object with it:
var dom
When there's no root element you'll need to use filter() to get top level elements:
filter()
var string = ""; var $dom = $(string).appendTo('body'); // appendTo() is only for purposes of this demo $dom.filter("p").text('hello world!');