2013-03-26 45 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