title: jQuery: how to get the index of a checked radio button
body: <p>I recently came across a StackOverflow answer that gave excellent instructions on <a href="https://stackoverflow.com/questions/596351/how-can-i-get-which-radio-is-selected-via-jquery">how to get the value of a checked radio button using jQuery</a>:</p>
  
  <pre><code>var radioVal = $("#myFormID input:radio[name='radioFieldName']:checked").val();
  alert('Selected radio button value = ' + radioVal);
  </code></pre>
  
  <p>Now I'm trying to find the zero-based index of the checked radio button.  I thought it would be relatively simple:</p>
  
  <pre><code>var radioIdx = $("#myFormID input:radio[name='radioFieldName']:checked").index();
  </code></pre>
  
  <p>However, <code>radioIdx</code> is always returning a value of <code>-1</code>.  Any ideas on what I might be doing wrong?</p>