Unable to use selectors on the root element
I was using the jQuery() to create a DOM element using HTML, then
tried to use a selector on the new DOM element and noticed that the
selection did not recognize the root element... is that supposed to be
that way?
For example:
$tempForm = $('<form><input type="submit" value="Go!"></form>');
$('form', $tempForm).submit(function(){ alert('I was here'); return
false; });
Does nothing. But if you make it so the form is not the root element
(eg '<div><form><input type="submit" value="Go!"></form></div>') then
the selector works fine...
Thanks,
Randy