title: jQuery find input type (but also for select)
body: <p>I need to find the input type for radio buttons, text, and selects. Its easy to find the input type of anything with <code>&lt;input type="x"&gt;</code> since <code>$(this).attr("type")</code> would return <code>x</code></p>
  
  <p>My issue is that I need to support <code>&lt;select&gt;</code> elements, which dont have the type attribute. The end goal is to do return either radio, text, or select.</p>
  
  <p>I thought of doing something like this, but I was curious if there's a better way:</p>
  
  <pre><code>if ($(this).tagName == "input") {
      var result = $(this).attr("type");   //returns radio or text (the attr type)
  } else {
      var result = $(this).tagName;        //returns select (the element type)
  }
  </code></pre>
  
  <p>Thanks all!</p>