Home > Web Front-end > JS Tutorial > JS public small method to determine whether the object is an instance of domElement

JS public small method to determine whether the object is an instance of domElement

高洛峰
Release: 2016-12-05 13:22:11
Original
921 people have browsed it

The example is as follows:

function isDOMElement(obj) {
         return !!(obj && typeof window !== 'undefined' && (obj === window || obj.nodeType));
        }
Copy after login

The above example of JS public method to determine whether the object is domElement is all the content shared by the editor


Related labels:
js
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template