屬性我有這樣取消選中複選框以JavaScript
<ul id="anotherdata" class="live-search-list" style="display: block;">
<li class="list_items" data-search-term="systimehour "><div class="row"><div class="col-xs-2 col-md-1"></div><div class="col-xs-10 col-md-11"><div class="item"><div class="item-title">SysTimeHour<span class="pull-right"><input type="checkbox" value="SysTimeHour" name="checkbox"></span></div> </div></div></div></li>
<li class="list_items" data-search-term="systimemin "><div class="row"><div class="col-xs-2 col-md-1"></div><div class="col-xs-10 col-md-11"><div class="item"><div class="item-title">SysTimeMin<span class="pull-right"><input type="checkbox" value="SysTimeMin" name="checkbox"></span></div> </div></div></div></li>
上另一方面我有一個函數調用,其中i需要取消選中 選擇複選框
function tagremove(i)
{
$('.live-search-list li').each(function(){
var datavalue= $(this).data("search-term");
// alert(datavalue);
if(datavalue==i)
{ $(this).attr("checked", false); } });
}
在立一個複選框
但這不起作用。
的[設置「檢查」與jQuery的複選框可能的複製?](http://stackoverflow.com/questions/426258/setting-checked-for-a-checkbox-with-jquery) –