我该如何使用jQuery计算动态生成的具有相同类名的元素数量?
我找到了一个类似的问题,但很遗憾它没有起作用。
我做了类似于以下答案的东西: jQuery counting elements by class; what is the best way to implement this?
我找到了一个类似的问题,但很遗憾它没有起作用。
我做了类似于以下答案的东西: jQuery counting elements by class; what is the best way to implement this?
$('.capital_class').live('blur', function(){
alert($(this).length);
});
具有 capital_class 类的元素是动态生成的。但是每当我失去焦点时,我总是得到长度为1的结果。如何正确获取其长度?
.capital_class
,而不是this
。 - Puzo