开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜