jquery - how to identify a form field type
<p>I would like to know the different elements and their types in a form.</p>

<p>My HTML looks like this:</p>

<pre><code>&lt;form action="save_form" method="post" id="newform" name="newform"&gt;
          &lt;div class="form_description"&gt;
            &lt;h2 class="editable"&gt;Form title. Click here to edit&lt;/h2&gt;
            &lt;p class="editable"&gt;This is your form description. Click here to edit.&lt;/p&gt;
          &lt;/div&gt;
          &lt;ul id="form_body" class="ui-sortable"&gt;
          &lt;li id="field1" class=""&gt;
            &lt;a href="#" onclick="return false;" class="hover"&gt;
            &lt;label class="editable" for="field1"&gt;Text1&lt;/label&gt;
            &lt;input type="text" name="field1" value=""&gt;
            &lt;/a&gt;
            &lt;/li&gt;
            &lt;li id="field2" class=""&gt;
            &lt;a href="#" onclick="return false;" class="hover"&gt;
            &lt;label class="editable" for="field2"&gt;Paragraph2&lt;/label&gt;
            &lt;div&gt;&lt;textarea cols="" rows="" class="textarea" name="field2"&gt;&lt;/textarea&gt;&lt;/div&gt;
            &lt;/a&gt;
            &lt;/li&gt;
            &lt;li id="radiogroup3" class=""&gt;
            &lt;a href="#" onclick="return false;" class="hover"&gt;
            &lt;label class="editable" for="radiogroup3"&gt;Label3&lt;/label&gt;
            &lt;input type="radio" id="radiogroup31" name="radiogroup3" value="1" class="element radio"&gt;
            &lt;label class="choice editable" for="radiogroup31"&gt;option1&lt;/label&gt;
            &lt;input type="radio" id="radiogroup32" name="radiogroup3" value="2" class="element radio"&gt;
            &lt;label class="choice editable" for="radiogroup32"&gt;option2&lt;/label&gt;
            &lt;input type="radio" id="radiogroup33" name="radiogroup3" value="3" class="element radio"&gt;
            &lt;label class="choice editable" for="radiogroup33"&gt;option3&lt;/label&gt;
            &lt;/a&gt;
            &lt;/li&gt;&lt;/ul&gt;
        &lt;/form&gt;
</code></pre>

<p>I came up with the function below but this.type does not return any value (undefined) even though 
firebug console shows the correct value.</p>

<p>I cannot use attr('type') since it does not work for textarea and labels.</p>

<pre><code>test = $('#newform').map(function(){ return $.makeArray(this.elements); });

if (test.length != 0) {
    test.each(function(){
        console.log($(this).type);
    });
}
</code></pre>

<p>Is there a way in which I can get all elements in a form, including label, textarea and radio buttons.</p>
