title: Finding a form element's type after finding it by name or id
body: <p>Probably a dumb question, but is there a way in JavaScript to find out a form element's type (text, checkbox, etc.) from a form element after finding it by name or id? Either in plain old JavaScript or using jQuery-style syntax or methods would be ideal.</p>
  
  <p>Example:</p>
  
  <pre><code>&lt;input type="text" name="my_text_input" id="my_text_input"/&gt;
  &lt;script&gt;var element = document.getElementById('my_text_input'); // now how to get the element type?&lt;/script&gt;
  </code></pre>
  
  <p>I'm not looking for alternatives, this is exactly what I want to do. I'm making a sort of screen scraper that needs to collect this information.</p>