Get the current radio element index?
<p>when i'm iterating a collection of inputs, how can I get the current radio index if the input is part of a group of radios?</p>

<pre><code>$('input').each(function(){

  if($(this).is(':radio')){
    // here get the index of the radio in the radio group,
    // like 1, 2, 3 etc... 
  }


});
</code></pre>

<p>The index should be relative to the radio group, no the entire collection of input elements. </p>

<p>The group is determined by the input name (inputs having the same name).</p>
