X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=jquery%2Fjquery.js;h=86041dc29ced78a88a0815d80a4f6cb374067169;hb=057381c70d6ff56733d7dc25c86ab5c4ab047430;hp=6263607aa9e9de097a04e1b6f7bcf0888606ccb6;hpb=70cab836b0d87ec1a94658411c398658780f5810;p=jquery.git diff --git a/jquery/jquery.js b/jquery/jquery.js index 6263607..86041dc 100644 --- a/jquery/jquery.js +++ b/jquery/jquery.js @@ -423,10 +423,13 @@ $.fn.domManip = function(fn){ var obj = this; if ( this.nodeName == 'TABLE' ) { - if ( !this.firstChild ) { - this.appendChild( document.createElement("tbody") ); - } - obj = this.firstChild; + var tbody = this.getElementsByTagName("tbody"); + + if ( !tbody.length ) { + obj = document.createElement("tbody"); + this.appendChild( obj ); + } else + obj = tbody[0]; } $.apply( obj, fn );