Ticket #6604 (closed bug: duplicate)
html() usage can destroy forms in Internet Explorer 8.
|Reported by:||jonathan.slenders||Owned by:|
Maybe this is rather an IE8 bug than JQuery bug, I'm not sure.
Internet explorer often strips the quotes around html attributes, and therefore, the html variable in the code below will contain somewhere: "<form action=/action/a/>" The forward-slash/greater-than combination will also act as the end of the form.
var html = $('<div><p><form action="/action/a/" method="get"><input type="submit" value="aaa" /></form></p></div>').html(); alert ($(html).html());
This will display:
<FORM method=get action=/action/a></FORM><INPUT value=aaa type=submit></FORM>
This behaviour in IE8, will make the following code inreliable, as it can destroy the forms.
Tested in Jquery 1.4.1