Understanding behavior of .html() function
Hey folks
I'm not really understanding why the following statement..
- alert(
- $(
- '<root><html><head><title>MyTitle</title></head><body><p style="background-color:red;">Hello!</p></body></html></root>'
- ).html()
- );
..returns the following in Firefox 3.6.3, Safari and Google Chrome..
- <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.