<!DOCTYPE html>
<html>
<head>
<script src="https://code.jquery.com/jquery-git.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Check if object is a jQuery object.</title>
</head>
<body>
</body>
</html>
JavaScript Code:
var obj1 = { what: "A regular JS object" },
obj2 = $('body');
if ( obj1.jquery )
{
console.log('obj1 is a jQuery object.');
}
if (obj2.jquery )
{
console.log('obj2 is a jQuery object.');
}
HTML Code :
JavaScript Code: