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;
Related Contents:
- How to send FormData objects with Ajax-requests in jQuery? [duplicate]
- Selecting text in an element (akin to highlighting with your mouse)
- Add table row in jQuery
- jQuery Validate Plugin – How to create a simple custom rule?
- AJAX cross domain call
- Can I find events bound on an element with jQuery?
- How can I create an Asynchronous function in Javascript?
- Finding line-wraps
- onClick not working on mobile (touch)
- JavaScript or jQuery browser back button click detector
- Force a browser to save file as after clicking link [duplicate]
- Check if an array is empty or exists
- Download pdf file using jquery ajax
- How to pass parameters in GET requests with jQuery
- How to use jQuery in Firefox Extension
- What is the meaning of symbol $ in jQuery?
- Dynamically arrange some elements around a circle
- Dynamically loading css stylesheet doesn’t work on IE
- Contain form within a bootstrap popover?
- How to convert dataURL to file object in javascript?
- Attach an event in a child iframe to a handler in the parent window
- Get week of the month
- Differences between contentType and dataType in jQuery ajax function
- jQuery Youtube URL Validation with regex
- Get Character value from KeyCode in JavaScript… then trim
- Changing width property of a :before css selector using JQuery [duplicate]
- JS setInterval executes only once
- How can I differentiate a manual scroll (via mousewheel/scrollbar) from a Javascript/jQuery scroll?
- Use jQuery to get the file input’s selected filename without the path
- jQuery x y document coordinates of DOM object
- How do I get an element to scroll into view, using jQuery?
- simulate background-size:cover on or
- jQuery equivalent of getting the context of a Canvas
- Detect if a page has a vertical scrollbar?
- Why does multiple modal using twitter bootstrap got error too much recursion?
- Proper way to detect WebGL support?
- How to bind click event to object tag?
- How to disable Paste (Ctrl+V) with jQuery?
- Alert for unsaved changes in form
- Inserting arbitrary HTML into a DocumentFragment
- keep placeholder on focus in IE10
- Can you wait for javascript callback?
- Implementing jquery UI autocomplete to show suggestions when you type “@”
- combo box is getting vanished when an alert is coming
- Why would one use the Publish/Subscribe pattern (in JS/jQuery)?
- Convert returned JSON Object Properties to (lower first) camelCase
- Chartjs Bar Chart showing old data when hovering
- Transform Javascript Array into delimited String
- Disabling links to stop double-clicks in JQuery
- How to grab keyboard events on an element which doesn’t accept focus?