<div id="selected">
  <ul>
    <li>29</li>
    <li>16</li>
    <li>5</li>
    <li>8</li>
    <li>10</li>
    <li>7</li>
  </ul>
</div>
Tôi muốn đếm tổng số <li>phần tử trong <div id="selected"></div>. Làm thế nào là có thể sử dụng jQuery .children([selector])?
                  stackoverflow.com/questions/250688/
                
                
                  
                    —
                     hy
                    
                  
                
              
                  Trong JS thuần túy, câu trả lời của @ Mo. vẫn còn thấp, nhưng hãy sử dụng
                
                  
                    —
                    Charles L. 
                    
                  
                
              element.childelementCount