Created
October 27, 2014 10:08
-
-
Save CiprianSpiridon/1d3d8b73d87c4af26b16 to your computer and use it in GitHub Desktop.
Function to check if the argument passed is an object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Returns true if the given object is an element. | |
* @param cElem {object/jQuery} | |
* @returns {boolean} | |
*/ | |
function isDomElement(cElem) | |
// use this for jQuery objects | |
if (cElem && cElem.jquery) { | |
cElem = cElem.get(0); | |
} | |
return (typeof thing === "object" && typeof thing.nodeName !== "undefined"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment