The picture is as above, and then paste the html structure
web
javascript
css
css2.0
css3
html
5555 可视化
555
Suppose I have taken the outermost frame of second
Now I want to get the "web
", "555
" (a), "5555
(b)" How to store the anonymous text in a variable?
I triedinnerText
will get the text in the child node
UsechildNodes[0].nodeValue
will only get the first text node
Is it feasible to useif
to determine whethernodeType
is a text node?
I don’t know if there is a better way to directly get the text of the current box without getting the text in the child node~
Among them, the text node is an instance of
Text()
, and you can usedata
orwholeText
to get text of typeString
.