title: Index of same name element jquery
body: <p>I have many elements with same name:</p>
  
  <pre><code>&lt;input type="text" name="Education[GraduationDate][0]" /&gt;
  &lt;input type="text" name="Education[GraduationDate][1]" /&gt;
  &lt;input type="text" name="Education[GraduationDate][2]" /&gt;
  &lt;input type="text" name="Education[GraduationDate][3]" /&gt;
  </code></pre>
  
  <p>I want jquery give me the index number of selector name, so if I select first one give me number (0), and so on.</p>
  
  <p>I did this with jquery:</p>
  
  <pre><code> var arrayname = $(this).attr('name');
   var arrayindex = arrayname.substring(24,25);
  </code></pre>
  
  <p>arrayindex return me the <strong>Index</strong> that I want, but I think this is not good way to do that, because maybe You have index with 2 digit number, so the substring not work fine.</p>
  
  <p>Please advice ..</p>