I need a way to determine the type of an HTML element in JavaScript. It has the ID, but the element itself could be a f
nodeName is the attribute you are looking for. For example:
var elt = document.getElementById('foo');
console.log(elt.nodeName);
Note that While this would not give you the expected results:nodeName returns the element name capitalized and without the angle brackets, which means that if you want to check if an element is an elt.nodeName == "DIV"
elt.nodeName == "