Tags

, , , , , , ,


<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript">
 var count = $("#selected li").length;

//If you have to use  .children()
 var count1 = $("#selected ul").children().length;

 var count2 = $("#selected ul").size() ;

 alert(count);
 alert(count1);
 alert(count2);
</script></pre>
<div id="selected">
<ul>
    <li>29</li>
    <li>16</li>
    <li>5</li>
    <li>8</li>
    <li>10</li>
    <li>7</li>
</ul>
</div>
<pre>
Advertisements