[jQuery] Find nodes
Hi All, I have the below HTML assigned to a variable in JS. HTML: #ChevronSPAN4 lt;lt; #ChevronSPAN4id= gt;gt; Please let me know using jQuery how can I search the variable for SPAN elements with class=cheveron. Thanks, Sandeep -- View this message in context: http://old.nabble.com/Find-nodes-tp27468324s27240p27468324.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
Re: [jQuery] Find nodes
On Fri, Feb 5, 2010 at 8:14 AM, san82 sandee...@spanservices.com wrote: I have the below HTML assigned to a variable in JS. HTML: #ChevronSPAN4 lt;lt; #ChevronSPAN4id= gt;gt; Please let me know using jQuery how can I search the variable for SPAN elements with class=cheveron. I'm guessing your variable got munged, eh? Do you mean you have a string of HTML? If so, you could DOMify it then search in that. var tempDiv = document.createElement('div'); tempDiv.innerHTML = (your variable); var cheverons = $(tempDiv).find(span.cheveron); Nathan
Re: [jQuery] Find nodes
Nathan Klatt-2 wrote: On Fri, Feb 5, 2010 at 8:14 AM, san82 sandee...@spanservices.com wrote: I have the below HTML assigned to a variable in JS. HTML: #ChevronSPAN4 lt;lt; #ChevronSPAN4id= gt;gt; Please let me know using jQuery how can I search the variable for SPAN elements with class=cheveron. I'm guessing your variable got munged, eh? Do you mean you have a string of HTML? If so, you could DOMify it then search in that. var tempDiv = document.createElement('div'); tempDiv.innerHTML = (your variable); var cheverons = $(tempDiv).find(span.cheveron); Nathan Yes, this is what I needed...Thanks -- View this message in context: http://old.nabble.com/Find-nodes-tp27468324s27240p27468911.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.