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
精彩评论