Find all text from all elements that are not hidden
by lshettyl
JavaScript
var sample = $("<div><span style='display:none'>not </span>good <div>content</div></div>");
var t = sample.clone();
$('body').append(t);
t.find('*:not(:visible)').remove();
//t.remove();
alert(t.text());