如何获得li checkbox
在jquery中检查状态。如何获得li chechbox在jquery中检查状态
我想要这个,但它扔我不确定。
$('#ul'+$Id+' li:nth-child('+_index+') span input:checkbox').attr("checked")
任何人都可以从这一个帮助。
如何获得li checkbox
在jquery中检查状态。如何获得li chechbox在jquery中检查状态
我想要这个,但它扔我不确定。
$('#ul'+$Id+' li:nth-child('+_index+') span input:checkbox').attr("checked")
任何人都可以从这一个帮助。
在您的jQuery对象上使用.is(':checked')
。
$('#ul'+$Id+' li:nth-child('+_index+') span input:checkbox').is(':checked');
为什么在javascript中变量$ id? _index是否可变?
可以检查复选框像
$(selector).prop('checked', true);
$(selector).prop('checked', false);
$(selector).attr('checked','checked');
$(selector).removeAttr('checked');
alert($(selector).is(':checked'));
的$ id持有检查UL – 2013-03-26 09:06:29
以下,但在JavaScript中的ID $ id为无效的变量 – Arvind 2013-03-26 09:09:19
它仅返回假的真不了 – 2013-03-26 09:04:29