我無法將複選框選中爲取消選中複選框。將選中的複選框設置爲取消選中
$("#search_list").find('.mselect input:checked').each(function(index, ele) {
var prodId = $(this).val();
console.log($(this));
//if($(this).is(':checked')){
//if($(this).length) {
$(productList).each(function(key, value) {
console.log("ohh"+value);
if(prodId == value){
$(this).prop('checked', false);
console.log($(this));
console.log("unchedk"+value);
}
});
//}
});
我的錯誤是什麼?
您應包括控制你想改變你可以在瀏覽器控制檯中看到的HTML,以及任何錯誤消息的變量。 – Tony