This bug isn't what you think. You are using XHTML syntax (self closing tags) in an HTML context (the page is not served with content type application/xhtml+xml). When the page is served as HTML (not a bad thing, since the XHTML media type is not well supported), you can't self-close elements like
<div>. See the above document, section A.3. Some UAs (WebKit, I've noticed) actually log errors when you do what you're doing.
Here's your test page served as XHTML and as HTML. I only modified it by inserting your HTML snippet directly into the document, so we can compare how the browser parses it with how it's inserted by jQuery. If you look at both pages with a DOM inspector, you'll notice that the div in the HTML and the div inserted by jQuery are identical, but they're different between the two pages.
Older versions of jQuery filter the text passed to
$.fn.html() and convert
<div /> into
<div></div> before feeding it to the browser, which masks the problem. 1.4 still does this filtering in some cases (like
$.fn.append()) but not in
$.fn.html(), so your bad markup is revealed.