mirror of
https://github.com/jquery/jquery.git
synced 2026-02-14 03:44:55 -05:00
Manipulation: don't auto-insert tbody
Fixes gh-1835 Closes gh-2021
This commit is contained in:
@@ -57,14 +57,14 @@ wrapMap.optgroup = wrapMap.option;
|
||||
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
|
||||
wrapMap.th = wrapMap.td;
|
||||
|
||||
// Manipulating tables requires a tbody
|
||||
function manipulationTarget( elem, content ) {
|
||||
return jQuery.nodeName( elem, "table" ) &&
|
||||
jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
|
||||
if ( jQuery.nodeName( elem, "table" ) &&
|
||||
jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) {
|
||||
|
||||
elem.getElementsByTagName("tbody")[0] ||
|
||||
elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
|
||||
elem;
|
||||
return elem.getElementsByTagName( "tbody" )[ 0 ] || elem;
|
||||
}
|
||||
|
||||
return elem;
|
||||
}
|
||||
|
||||
// Replace/restore the type attribute of script elements for safe DOM manipulation
|
||||
|
||||
Reference in New Issue
Block a user