<input type="checkbox" onclick="checkboxOnclick(this)" /> <script> function checkboxOnclick(checkbox){ if ( checkbox.checked == true){ //Action for checked }else{ //Action for not checked } } </script> 轉載:https://blog…
/* 调用完该方法,原数组只留下非重复的数据 返回一个数组,里面是依次出现的重复元素 */Array.prototype.distinct = function () { var removeArr = [], retainArr = []; for (var i = 0; i < this.length; i ++) { var elem = this[i]; if (this.indexOf(elem) !== i ) { rem…