[jQuery] Passing a jquery object as a function parameter

[jQuery] Passing a jquery object as a function parameter


I had a script that was acting unexpectedly because of a function
parameter. I was trying to pass a jquery object through a function to
attach some events. I was wondering if someone could tell me why this
didn't fly:
function doStuff(theform) {
theform.show();
}
doStuff($('myForm'));
The fix was to pass the id as a string:
function doStuff(theform) {
$(theform).show();
}
doStuff('myForm');
Is there a reason why I couldn't pass the object directly through?
Thanks
Thanks