title: determining input vs textarea in jQuery
body: <p>I wish to iterate through a form, adding each element to an area. The problem is that some of these elements are select, input, and textboxes. I know that I can use <code>:input</code> to solve the problem here (though, I don't really need to). The issue is that I'm having trouble determining how I could see whether or not the element is a textarea, input, select, etc. I need to do this properly because, as far as I know, <code>jQuery("input#someinput").val()</code> works great for inputs, but for a textarea I may need <code>jQuery("textarea#sometexarea").text()</code>. I'm not sure if this exists...</p>
  
  <p>Anyway, here's my function so far:</p>
  
  <pre><code>function getAllFormElements(id) {
  
      var elements = new Array();
  
      jQuery(id).children().map(function(){
  
          for (var index = 0; index &lt; children.length; index++) {
  
              elements[i] = jQuery(children[i]).val();
  
          }
  
      })
  
          return elements;
  }
  </code></pre>