Try: $(".targetMe", $(testHTML)).html();
or: $(testHTML).find('.targetMe').html(); You might get into trouble with that and the html and body tags, not sure. In that case you had to create your own document fragment... --Klaus On 21 Apr., 03:28, default_user <ayapej...@gmail.com> wrote: > I'm trying to get jquery to parse some text in a variable as HTML, has > anyone tried this before and got it to work? Can this even be done, > or do I have to parse as text? > > <CODE> > > testHTML = "<html><head></head><body><ul><li class='targetMe'>TESTING</ > li></ul></body></html>"; > > testGetHTML = $(".targetMe", testHTML).html(); > > alert( testGetHTML ); > > </CODE>