title: How can I determine the type of an HTML element in JavaScript?
body: <p>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 <code>&lt;div&gt;</code>, a <code>&lt;form&gt;</code> field, a <code>&lt;fieldset&gt;</code>, etc. How can I achieve this?</p>