In a web page,i want to get every visible text in a textnode.I don’t want to put all the result into one array.I mean, when i meet a visible text, i will do something else.
How could i achieve it?
In a web page,i want to get every visible text in a textnode.I don’t
Share
I guess you want something like this:
The script as it is might be a bit overzealous, you get along a lot of invisible text nodes, you can sort those out if you don’t need them.
Edit: Modified to sort out invisible nodes since you specifically requested only visible nodes.