- jQuery: find the number of elements from a jQuery query
jQuery: find the number of elements from a jQuery query
In jQuery 1.0 and later
const n = $('.myclass').length;
In jQuery 1.8 to 3.0
const n = $('.myclass').size();
Copyright © 2008-2022, dave. Code samples on Dave's Brain is licensed under the
Creative Commons Attribution 2.5 License.
other material, including English text has all rights reserved.