I'm trying to find all text nodes on the page using jquery. But no matter what element I select, the nodeType is always 1:
$.each($('*'), function(index, el) { console.log(el.nodeType) });
Which resulted in nothing but "1" being output in the console. And to prove there is a "text node" on the page:
$('p:first').html()
=> "
I'm text
"
$('p:first')[0].nodeType
=> 1
What am I missing here? I'm using safari 5.0.4. I get the same result in firefox 3.6.12.
Thanks.