如何獲得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