I want to create function that can be used either with Id or by passing jQuery object.
var $myVar = $('#myId');
myFunc($myVar);
myFunc('myId');
function myFunc(value)
{
// check if value is jQuery or string
}
How can I detect what kind of argument was passed to the function?
Note! This question is not same. I don't want to pass selector string like #id.myClass. I want to pass the jQuery object like in the example.
value instanceof of jQuery(le mans: detecting an instance of jQuery object) would be the answer.