I have:
<div id="container">
<div class="comment_text">
<a>Blah blah</a> THIS IS WHAT I NEED
</div>
</div>
I want to get the text THIS IS WHAT I NEED from the above div, this is what I do usually:
var val = $.trim($('#container').find('.comment_text').text());
but this also gets the a tag, so how I should get only the text? I'm thinking of next() but it's not working:
var val = $.trim($('#container').find('.comment_text a').next().text());
Thanks
var val = $.trim($('#container').find('.comment_text a').text());should work.comment_text a? notice thisatag