How can i find out if an Object is Wrapped by jQuery.
var obj = $('div');
if(obj is a jQuery wrapped object)
{
then do something
}
I am quite new in the Javascript World.
Thanks in advance.
Here you go:
var isJQuery = obj instanceof jQuery; // or obj instanceof $;
if (obj.jquery) {
/* Do something */
}
That's the simplest way. Checking the object's constructor is another option but note that it won't work across global contexts (e.g. between a parent page and a frame).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With