JQuery: how to know the kind of form object we are dealing with?
<p>I am building a interactive form and loading the fields according to the answer of the user. Right now I just have two kind of objects "input radio" and "textarea". As I am getting the value of the answers via JQuery, how can I know what object I am dealing with inside the very LAST loaded fieldset?</p>

<p>This is what I am trying:</p>

<pre><code>$.fn.getNodeName = function() { // returns the nodeName of the first matched element, or ""
    return this[0] ? this[0].nodeName : "";
};

//var $something = $('input[type=radio]:checked:last');
var $something = $('fieldset:last').parent('nth-child(2)');

//$('#news ul li:first-child').addClass('active');

alert($something.getNodeName());
</code></pre>

<p>But it's not working...
Thanks.</p>
