嗨,我有复选框可以在点击时添加一个值。但是,即使我取消选中该框,它也会添加。取消选中该框时如何删除附加值?谢谢!
$('.addCheckBox').click( function( event ){
var btn = $(event.currentTarget);
var Data = btn.data();
var addList = $('#ListBtn');
var Obj = {
aID: Data.id,
aName: Data.name
};
addList.push( Obj );
addListBtn[0].innerHTML = "(" + addList.length + ") in List";
});