有很多<label name="delQ" style="cursor:pointer">Remove</label> 网页中的元素;元素是动态创建的。如何确定多少<!>“delQ <!>”;存在于当前网页中?

$('[name="delQ"]').live('click', function() {
//Get the number of name="delQ" in the current web page.
});

如何在Jquery中完成?

有帮助吗?

解决方案

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

长度

  

返回。中元素的数量   jQuery对象。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top