jquery getting index of selected checkbox
<p>I have some HTML like this:</p>

<pre><code>&lt;div id="Myclass"&gt;

 &lt;div class="Wrapper"&gt;
    &lt;input type="checkbox" class="SomeCheckboxClass"&gt;
    &lt;input type="checkbox" class="SomeCheckboxClass"&gt;
    &lt;input type="checkbox" class="SomeCheckboxClass"&gt;
 &lt;/div&gt;

 &lt;div class="Wrapper"&gt;
    &lt;input type="checkbox" class="SomeCheckboxClass"&gt;
    &lt;input type="checkbox" class="SomeCheckboxClass"&gt;
    &lt;input type="checkbox" class="SomeCheckboxClass"&gt;
 &lt;/div&gt;

&lt;/div&gt;
</code></pre>

<p>I want to find the index of a the selected textbox, if any.</p>

<p>For now, I wrote this:</p>

<pre><code>$('#MyClass .Wrapper').each(function () {

    Index = 0;

    $(this).find('.SomeCheckboxClass').each(function () {
        if ($(this).attr('checked')) {
            Index = $(this).index();
        }
    });

    SomeFunction(Index);
});
</code></pre>

<p>Is there a better way to do this?</p>

<p>Thanks.</p>
