I would like to get all descendant text nodes of an element, as a jQuery collection. What is the best way to do that?
if you want to strip all tags, then try this
function:
String.prototype.stripTags=function(){ var rtag=/<.*?[^>]>/g; return this.replace(rtag,''); }
usage:
var newText=$('selector').html().stripTags();