Skip to main content

Bug Tracker

Side navigation

#4507 closed bug (invalid)

Opened April 09, 2009 08:32AM UTC

Closed April 10, 2009 11:40PM UTC

problem on html() in IE

Reported by: shrimp Owned by:
Priority: major Milestone: 1.4
Component: unfiled Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:

the html() function return a wrong content, it help me add some unwant "<p>" tag (can see belows example code)

the alert for IE will be

"<p>show<span id=hidden><div>this is a div</div>this is a testing</span><p></p>"

an unwanted <p> added before the </p>

but it works great at firefox

example code:

<!DOCTYPE html PUBLIC "-W3CDTD XHTML 1.0 StrictEN" "">




<script src="./script/jquery-1.3.2.min.js" type="text/javascript"></script>

<script language="javascript">


var content = $("div.test-body").html();





<style type="text/css">

#hidden {






<div class='test-body'>

<p>show<span id="hidden"><div>this is a DIV</div>this is a testing</span></p>




Attachments (1)
  • style.html (0.7 KB) - added by shrimp April 09, 2009 08:33AM UTC.
Change History (1)

Changed April 10, 2009 11:40PM UTC by dmethvin comment:1

resolution: → invalid
status: newclosed

IE does not understand XHTML, and will treat your document using HTML4 rules. In HTML4, the

element cannot contain other block-level elements such as
, so your markup is invalid as far as IE is concerned.