Generate jQuery element from HTML, and find from it
I wrote the code as follows, but it didn't work well.
- var f = jQuery('<h1>foo</h1>').find('h1');
- console.log(f.size()); // expect 1, but actually 0
- console.log(f.text()); // expect "foo", but actually ""
What's wrong?