X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;f=src%2Fmanipulation.js;h=2dccc759255574810ac6881e4d4c4b25ba6ea079;hb=f95147f465932cb91e1a6aace50c556820ca4074;hp=543bbcd5e6535c1f27993542e18ea7141b48b489;hpb=f9417b9da980f4fa79d03ba691d9f3442c5ab2f2;p=jquery.git diff --git a/src/manipulation.js b/src/manipulation.js index 543bbcd..2dccc75 100644 --- a/src/manipulation.js +++ b/src/manipulation.js @@ -197,13 +197,15 @@ jQuery.fn.extend({ // as properties will not be copied (such as the // the name attribute on an input). var html = this.outerHTML, ownerDocument = this.ownerDocument; - if ( !html ) { + if ( !html || jQuery.nodeName( this, "form" ) ) { var div = ownerDocument.createElement("div"); div.appendChild( this.cloneNode(true) ); html = div.innerHTML; } return jQuery.clean([html.replace(rinlinejQuery, "") + // Handle the case in IE 8 where action=/test/> self-closes a tag + .replace(/=([^="'>\s]+\/)>/g, '="$1">') .replace(rleadingWhitespace, "")], ownerDocument)[0]; } else { return this.cloneNode(true);