0

How to check if object is a jQuery object?

The best way is to use instanceof operator:

obj instanceof jQuery

Example:

let div = $("<div/>");
let obj = {};

console.log(div instanceof jQuery); // true
console.log(obj instanceof jQuery); // false
RUN
add comment
Suggest a different solution or add another example