Determine if element is a text node using jQuery
<p>Given a jQuery element, how can I determine if the sibling on the right is a text node and not another element? In PHP, you would compare the <code>nodeType</code> to <code>#text</code> - what's the equivalent in this case?</p>

<pre><code>window.jQuery('body').find('a').each(function (i) {


    if(window.jQuery(this).next() == '?'){

    }


});
</code></pre>

<p>I am trying to work out what I can put in the condition part.</p>

<h2>Update</h2>

<pre><code>    if(window.jQuery(this).next().length != 0){

        alert(window.jQuery(this).next().get(0).nodeType);  

        if(window.jQuery(this).next().get(0).nodeType == 3){

            alert('right has text');

        }
</code></pre>

<p>For some reason, all my tests keep returning a 1 rather than a 3 to indicate text nodes!</p>
