2013-03-26 46 views

回答

3

在您的jQuery对象上使用.is(':checked')

$('#ul'+$Id+' li:nth-child('+_index+') span input:checkbox').is(':checked'); 
+0

它仅返回假的真不了 – 2013-03-26 09:04:29

0

为什么在javascript中变量$ id? _index是否可变?

可以检查复选框像

$(selector).prop('checked', true); 
$(selector).prop('checked', false); 
$(selector).attr('checked','checked'); 
$(selector).removeAttr('checked'); 
alert($(selector).is(':checked')); 
+0

的$ id持有检查UL – 2013-03-26 09:06:29

+0

以下,但在JavaScript中的ID $ id为无效的变量 – Arvind 2013-03-26 09:09:19