Skip to content

Instantly share code, notes, and snippets.

@CiprianSpiridon
Created October 27, 2014 10:08
Show Gist options
  • Save CiprianSpiridon/1d3d8b73d87c4af26b16 to your computer and use it in GitHub Desktop.
Save CiprianSpiridon/1d3d8b73d87c4af26b16 to your computer and use it in GitHub Desktop.
Function to check if the argument passed is an object
/**
* 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