With jQuery
you can use
$('#main-div .specific-class').length
otherwise in VanillaJS (from IE8
included) you may use
document.querySelectorAll('#main-div .specific-class').length;
More Related Contents:
- how do i submit message to my email by html or js?
- JS hide function error
- How to create button to check uncheckable checkbox
- Need to scroll to bottom whenever a new div is added at bottom
- Validation of file extension before uploading file
- JSFiddle code not working in my own page
- Moment js date time comparison
- Best cross-browser method to capture CTRL+S with JQuery?
- Obtain form input fields using jQuery?
- How to use jQuery in chrome extension?
- How to upload a file using jQuery.ajax and FormData
- How to get all of the IDs with jQuery?
- Make scrollbar visible in mobile browsers
- Set date in input type date
- Get data from PHP array via AJAX and jQuery
- jQuery width() and height() return 0 for img element
- infinite-scroll jquery plugin
- jQuery Validation using the class instead of the name value
- In Firebase when using push() How do I pull the unique ID
- jQuery/Javascript – How to wait for manipulated DOM to update before proceeding with function
- Adding a table row in jQuery
- Using jQuery AJAX to download a binary file
- Inconsistent behavior of toLocaleString() in different browser
- Sorting an Array of JavaScript Objects a Specific Order (using existing function)
- Sending a MediaStream to host Server with WebRTC after it is captured by getUserMedia
- JQuery function only works within a function
- Selecting elements without jQuery
- Function not calling within an onclick event
- refresh div with jquery
- How to focus an input field on Android browser through javascript or jquery