programming-examples/js/Object/Check whether a specified value is a DOM element .js
2019-11-15 12:59:38 +01:00

4 lines
134 B
JavaScript

function is_dom_element(obj) {
return !!(obj && obj.nodeType === 1);
}
console.log(is_dom_element(jQuery('body')[0]));