So if I have a variable like
var ht = \"Paragraph Here
\"
If it was attached to the DOM I could
The jQuery object will take HTML and make it in to a DOM structure for further query, you can pass it in directly to create the object, or use it as a context if you just wish to query it.
Edit: For some reason it seems necessary to wrap it in a DIV, if not already within one in this example. See the jQuery object documentation on this method for further information.
See test framework for system at: http://jsfiddle.net/hUMqU/
var ht = "Paragraph Here
";
$('' + ht + '').find('p').text();
or as context:
var ht = "Paragraph Here
";
$('p', '' + ht + '').text();