Reputation: 4715
Take a look at the snippet below. Does it create a text node for the string "test" in the DOM? Can I select that node with jQuery for MooTools?
<div id="foobar">
test <img />
</div>
Upvotes: 1
Views: 1271
Reputation: 42140
//plain
var node = document.getElementById('foobar').childNodes[0];
//jquery
$("foobar").contents().eq(0);
this will give you a textnode which will include the whitespace around the text too
Upvotes: 0