Hi.
Is it possible to extract only the text of a tag element while excluding the tags that are children of the parent tag? Like, how can I get the text without getting the links that are named 'M'?
Right now I can get the text of the tag named 'vs' using this code:
But that includes the links, the M's, when I extract it into a textfield.
Is it possible to extract only the text of a tag element while excluding the tags that are children of the parent tag? Like, how can I get the text without getting the links that are named 'M'?
Right now I can get the text of the tag named 'vs' using this code:
Code:
document.getElementsByTagName('vs')[0].innerText
Code:
<vs>Lorim ipsum Lorim ipsum Lorim ipsum Lorim ipsum Lorim ipsum,<a onclick="showCrossRef('PopUp1');" id="CR">M</a>
<div id="PopUp1" class="PopUp">
<a href="PseudoLink1.html">Link 1</a>;
<a href="PseudoLink2.html">Link2</a>;
</div>
Lorim ipsum Lorim ipsum Lorim ipsum Lorim ipsum Lorim ipsum<a onclick="showCrossRef('PopUp2');" id="CR" >M</a>
<div id="PopUp2" class="PopUp">
<a href="PseudoLink3.html">Link 3</a>;
</div>
Lorim ipsum Lorim ipsum Lorim ipsum Lorim ipsum Lorim ipsum,<a onclick="showCrossRef('PopUp3');" id="CR" >M</a>
<div id="PopUp3" class="PopUp">
<a href="PseudoLink4.html">Link 4</a>;
<a href="PseudoLink5.html">Link5</a>;
<a href="PseudoLink6.html">Link 6</a>;
</div>
</vs>