Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to know type of dom element in js

let divElement = document.createElement('div');

if (divElement.nodeName == "DIV") //true
if (divElement.nodeName == "<div>") //false
 
PREVIOUS NEXT
Tagged: #type #dom #element #js
ADD COMMENT
Topic
Name
2+9 =