I\'m trying to get:
document.createElement(\'div\') //=> true
{tagName: \'foobar something\'} //=> false
In my own scripts, I used
I think that what you have to do is make a thorough check of some properties that will always be in a dom element, but their combination won't most likely be in another object, like so:
var isDom = function (inp) {
return inp && inp.tagName && inp.nodeName && inp.ownerDocument && inp.removeAttribute;
};