Substring not working on childNodes[0].nodeValue
<p>I'm trying to extract a text from td as discussed here 
<a href="http://stackoverflow.com/questions/13760664/replacing-a-part-of-text-inside-a-td#13760705">Replacing a part of text inside a td</a></p>

<pre><code>$('.my-table tr').each(function() {

     var contact = $(this).find('td').eq(1)[0].childNodes[0].nodeValue;
     $(this).find('td').eq(1).contents()[0].data = contact.substring(0,10);
});
</code></pre>

<p>But contact.substring(0,10); doesn't seem to work and it just shows empty.</p>

<p>How can i fix this?</p>
