Dave’s Brain
Home
Search
Browse
Recent
Keywords
Other sites
Feedback
Sign in
Random
Crawlers
Programming Tips
- jQuery: find the number of elements from a jQuery query
Language:
javaScript
Library:
jQuery
Date:
2017oct23
Q.
jQuery: find the number of elements from a jQuery query
A.
In jQuery 1.0 and later
const n = $('.myclass').length;
In jQuery 1.8 to 3.0
const n = $('.myclass').size();