How to get the texts without child element texts
<p>I want to get the texts in my div but not the texts in child div.</p>

<p>I have</p>

<p>html</p>

<pre><code>  &lt;div id='textDiv'&gt;
       texts I want to get
          &lt;span id='textChildDiv'&gt;
             texts I don't want
          &lt;/span&gt;
    &lt;/div&gt;
</code></pre>

<p>jquery</p>

<pre><code>  $('#textDiv').click(function(){
       alert($(this).text())  //will get 'texts I want to gettexts I don't want'
       //I only want 'texts I want to get' to be returned.
    })
</code></pre>

<p>I found </p>

<p><a href="http://viralpatel.net/blogs/jquery-get-text-element-without-child-element/" rel="nofollow">http://viralpatel.net/blogs/jquery-get-text-element-without-child-element/</a></p>

<p>for my soulution but it seems there are better approach than his way. </p>

<p>Any ideas? Thanks a lot!</p>
