开发者

how i can count the element who have the class "goo"

开发者 https://www.devze.com 2023-01-27 10:34 出处:网络
i want to check 开发者_如何学Chow much element have class \"goo\". are i can check for specific element or all using jQuery. show me how i can do this task in jQueryThere a .length property to see ho

i want to check 开发者_如何学Chow much element have class "goo".

are i can check for specific element or all using jQuery. show me how i can do this task in jQuery


There a .length property to see how many elements a jQuery object references, so just combine that with a .class selector, like this:

var count = $(".goo").length;


var amountOfGoo = $('.goo').length;


Maybe $(".goo").length


You can use the .length property. So something like var total = $('.goo').length; should do the trick.


$(".goo").length

0

精彩评论

暂无评论...
验证码 换一张
取 消