title: How to get input type by element name
body: <p>Is there any way to get type of input by having element name?</p>
  <pre><code>&lt;form name=&quot;formQuestionnaire&quot;&gt;
      &lt;input name=&quot;age&quot; type=&quot;radio&quot; id=&quot;age-1&quot; /&gt;
      &lt;input name=&quot;age&quot; type=&quot;radio&quot; id=&quot;age-2&quot; /&gt;
  &lt;/form&gt;
  
  document.forms['formQuestionnaire'].elements['age']
  </code></pre>
  <p>return radio / checkbox / text</p>