开发者

How to know how many of a particular kind of element exist in the current web page in Jquery?

There are many <label name="delQ" style="cursor:pointer">Remove</label> elements in a web page; the elements are dynamically created. How to determine how many "delQ" exist in the current web page?

$('[name="delQ"]').live('click', function() {
//Get the number of name="delQ" in the current we开发者_StackOverflow社区b page.
});

How to do it in Jquery?


$('label[name="delQ"]').length;

length

Returns the number of elements in the jQuery object.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜