JS设置checkbox单选

            searchForm.find('input[type="checkbox"]').click(function (evt) {
                if(evt.target.checked === true){
                    searchForm.find('input[type="checkbox"]').each(function () {
                        if(this.value !== evt.target.value){
                            this.checked = false;
                        }
                    });
                    //TODO: sth.
                }
            });

猜你喜欢

转载自www.cnblogs.com/chenss15060100790/p/12559392.html