Question and answer is powered by AnsPress.io
I have a HTML web page and in my HTML web page I want to count number of div under a parent div using jquery.
I follow this code:
<div class="publish"> <div class="published"></div> </div>
Here I want to count the element having published class.
Follow this code and count number of div under a parent div in jquery.
<script type="text/javascript"> var count_len=$('#publish_id > .published_class').length; alert(count_len); </script>