I\'m trying to get:
document.createElement(\'div\') //=> true
{tagName: \'foobar something\'} //=> false
In my own scripts, I used
here's a trick using jQuery
var obj = {};
var element = document.getElementById('myId'); // or simply $("#myId")
$(obj).html() == undefined // true
$(element).html() == undefined // false
so putting it in a function:
function isElement(obj){
return (typeOf obj === 'object' && !($(obj).html() == undefined));
}