I would like to get all descendant text nodes of an element, as a jQuery collection. What is the best way to do that?
Can also be done like this:
var textContents = $(document.getElementById("ElementId").childNodes).filter(function(){ return this.nodeType == 3; });
The above code filters the textNodes from direct children child nodes of a given element.