DOM/[removed] get text after tag

前端 未结 6 910
Happy的楠姐
Happy的楠姐 2021-01-05 00:59

How do I get the text \"there\" that comes after a tag in an html document:

hellothere

I see that the

6条回答
  •  灰色年华
    2021-01-05 01:45

    You can find children tags of your parent tag:

    var pTag = ...
    var childNodes = pTag.childNodes;
    

    Finally you can find your text in a text node after a node.

提交回复
热议问题