From: John Resig Date: Fri, 16 Jun 2006 00:33:55 +0000 (+0000) Subject: It's now possible to add s and s to a table, using only HTML. X-Git-Url: http://git.asbjorn.biz/?a=commitdiff_plain;h=cb3eada739ce377f80408abe2103c95d5a016918;hp=894fc4b280b9ea967a4da08ce6b26462837b033f;p=jquery.git It's now possible to add s and s to a table, using only HTML. --- diff --git a/jquery/jquery.js b/jquery/jquery.js index fafed0e..9cf6941 100644 --- a/jquery/jquery.js +++ b/jquery/jquery.js @@ -408,15 +408,25 @@ $.clean = function(a) { var r = []; for ( var i = 0; i < a.length; i++ ) { if ( a[i].constructor == String ) { - if ( a[i].indexOf(""; + } else if ( !a[i].indexOf(""; } + var div = document.createElement("div"); div.innerHTML = a[i]; - if ( tr ) { + + if ( tr || td ) { div = div.firstChild.firstChild; + if ( td ) { + div = div.firstChild; + } } + for ( var j = 0; j < div.childNodes.length; j++ ) { r[r.length] = div.childNodes[j]; }