Understanding behavior of .html() function

Understanding behavior of .html() function

Hey folks

I'm not really understanding why the following statement..

  1. alert(
  2.       $(
  3.             '<root><html><head><title>MyTitle</title></head><body><p style="background-color:red;">Hello!</p></body></html></root>'
  4.       ).html()
  5. );

..returns the following in Firefox 3.6.3, Safari and Google Chrome..

  1. <title>MyTitle</title><p style="background-color: red;">Hello!</p>

..and returns null in IE 8.0.6001.18702..

Why does it strip out the html, head and body elements?

My OS is Windows XP.