Thanks Adras, however, if you don't specifiy "testHTML" as an argument to $() then JQuery will function against the DOM instead of the content of a variable. The way your doing things looks like your trying to inject the contents of "testGetHTML" into the ".targetMe" element. Unless I'm mistaken.
On Apr 21, 8:31 am, András Csányi <sayusi.a...@gmail.com> wrote: > 2009/4/21 default_user <ayapej...@gmail.com>: > > > > > 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> > > Maybe I'm wrong, but the testHTML variable place is in the html > function, isn't? For example: > testGetHTML = $(".targetMe").html(testHTML); > Or I missunderstood what is your problem... :) > > András > > -- > - - > -- Csanyi Andras --http://sayusi.hu-- Sayusi Ando > -- "Bízzál Istenben és tartsd szárazon a puskaport!".-- Cromwell