-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Might be simpler to clone the element, then manipulate the cloned tree and simply return .text() at the end.
No recursion, no lengthy string concatenation. Need to test which algorithm performs faster (try http://jsperf.com/)
var clone = this.clone();
clone.find( 'script, noscript' ).remove();
clone.find( 'img' ).map(function() {
return this.alt;
});
clone.find( 'input' ).map(function() {
return this.value;
});
return clone.text();
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels