JS DOM: Get elements by text content.
- by hristo
Hello!
I am looking for a way to perform fulltext search on the DOM tree with JS. In two words, I would like to retrieve the list of text nodes which contain a given string.
I've tried mootools' Element.getElements ( ':contains[string]' ) but I can't get it to work with strings containing whitespace.
I'm thinking about simply indexing all text…