[jQuery] Why is getElementById different from $('testid')?
So I have this code to write a content to an iframe which works just
fine. I'm trying to rewrite it using Jquery though.
var f=document.getElementById('testiframe');
var doc = f.contentWindow ? f.contentWindow.document :
f.contentDocument ? f.contentDocument : f.document;
doc.open();
doc.write(scriptvar);
doc.close();
In testing, I'm finding that these are different:
1) var f=document.getElementById('testiframe');
2) var f=$('#testiframe');
So #1 gives [object HTMLIFrameElement] if I alert().
#2 gives [object Object].
What is the difference between these two?