Given this html string:
var string = \"\";
I create a jQuery object with it:
var dom
var html = ""; var parser = new DOMParser(); var dom = $(parser.parseFromString(html, "text/html")); //work with dom dom.find("p");
the parser will create an html document (not appended to your document).