JQuery : Count children that is checked in a <li> tag
<p>I have a tree view using html tags, when the "tvcheckbox attrParent" is checked, how can I count all its children "tvcheckbox attr" which where checked using JQuery.</p>

<pre><code> &lt;li class="others"&gt;&lt;input type="checkbox" value="ALPHABETS" class="tvcheckbox attrParent"&gt;ALPHABETS
    &lt;ul&gt;
        &lt;li&gt;&lt;input type="checkbox" class="tvcheckbox attr" value="A"&gt;A&lt;/li&gt;
        &lt;li&gt;&lt;input type="checkbox" class="tvcheckbox attr" value="B"&gt;B&lt;/li&gt;
        &lt;li&gt;&lt;input type="checkbox" class="tvcheckbox attr" value="C"&gt;C&lt;/li&gt;
        &lt;li&gt;&lt;input type="checkbox" class="tvcheckbox attr" value="D"&gt;D&lt;/li&gt;
        &lt;li&gt;&lt;input type="checkbox" class="tvcheckbox attr" value="E"&gt;E&lt;/li&gt;
        &lt;li&gt;&lt;input type="checkbox" class="tvcheckbox attr" value="F"&gt;F&lt;/li&gt;
    &lt;/ul&gt;
&lt;/li&gt;
</code></pre>

<p>I tried </p>

<pre><code>   `$('input.tvcheckbox.attrParent:checked').each(function(){
           var len = $(this).parent().children(".checked").length;
    });`
</code></pre>

<p>but is not successful. Can anyone help? Thank you in advance.  </p>
