Suppose I have created one jQuery function to check if elements exist or not like:
jQuery.fn.exists = function () {
return this.length > 0;
}
Then I call:
if ($("#MyDiv").exists() == false)
alert('not exist');
else
alert('exist');
If I call jQuery function above it works. But can't we call the jquery function like this way exists('#MyDiv')
? If I try to call this way then I am not getting result...why?