getting nodes without texts
<pre><code>$("br").parent().contents().each(function(i) {
   if(this.nodeType == "#Text")
    {
        alert(this.textContent);
    }
});
</code></pre>

<p>i am trying to select all texts not surrounded by html tags, but separated via <code>&lt;br&gt;</code></p>

<p>doing this, sometimes returns a lot of alert messages, even when there should only be a couple. </p>

<p>i have tried to filter it out using </p>

<pre><code>if(this.nodeValue != "") or if(this.textContent != "")
</code></pre>

<p>but still, empty alert messages pop up.</p>

<p>I suspect its the whitespaces in the html document (i dont control it). I only want to display <code>this.textContent</code>, which actually has visible text.</p>
