stuartpb
2015-07-27
This is something people want, and something that would be useful for polyfilling other properties and behaviors.
This is something people want, and something that would be useful for polyfilling other properties and behaviors.
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.
This post by John Resig I feel lays out a solid strategy for prollyfilling this method: http://ejohn.org/blog/unimpressed-by-nodeiterator/