How to get Node text using Dojo JS

I am trying to get text from a tag, but this tag has a nested node, which is also not needed. How do I get text?

for instance

<div id="i_want_the_text_in_this_div"> <span id="but_not_this_one"> ignore this text </span> keep this text </div> 
+4
source share
2 answers

Use dojo.attr(node, 'innerHTML') as textContent does not work in IE

+2
source

Try: dojo.query('#i_want_the_text_in_this_div')[0].lastChild.textContent;

+7
source

All Articles