I just discovered this issue, and I wanted to run it by everyone here to make sure I wasn't missing obvious something before I reported it.
Here is what's causing me a problem:
html = '<html><body><div id="test">This is just a test</div></body></html>';
alert( $(html).find('#test').html() );
The alert window shows null instead of the text inside #test. HOWEVER, if I simply wrap <div id="test"> in another div element, it works properly and returns the expected, "This is just a test".
This code works:
html = '<html><body><div><div id="test">This is just a test</div></div></body></html>';
alert( $(html).find('#test').html() );
Can someone explain to me why this would be happening? Why would the second example work but the first one not?