Text node (pseudo-)selector


#1

This is something people want, and something that would be useful for polyfilling other properties and behaviors.


Hide whitespace-only text nodes
#2

By the way, having a selector for text nodes would also allow to select them with querySelectorAll() in JS. Currently, there is no simple cross-browser native way to select nodes of arbitrary type (like getElementsByTagName(), but for nodes of any type), text nodes in particular.

Though a dedicated JS method like getNodesByType() would probably still be more reasonable for that purpose, but selector way would probably at least be better than nothing.


#3

This post by John Resig I feel lays out a solid strategy for prollyfilling this method: http://ejohn.org/blog/unimpressed-by-nodeiterator/