How do I get the text “there” that comes after a tag in an html document:
<p><a>hello</a>there</p>
I see that there is a way to do it with xpath:
but I’m not using xpath and am hoping not to have to start just for this. I realize that I can get ALL the text inside the p tag, but I want to get just the “there” text, as well as know its relationship to the p and a tags. It doesn’t seem to be anyone’s child or sibling. (You can assume that I can get any of the other elements/nodes so it can be relative to those.) Every DOM tutorial seems to ignore the fact that text can occur outside tags.
Thanks.
You can use several ways to get the tag and the text