• CheckBoxJS选中与反选得到Value


    function XuanZe(val) {
        datastr = $("#hid_AID").val();
        var newstr = "";
        if (datastr != "") {
            var str = new Array();
            str = datastr.split(",");
            var newstr = "";
            var bHas=false;
            for (i = 0; i < str.length-1; i++) {
                if (str[i] == val) {
                    bHas=true;
                } else {
                    alert(newstr);
                    newstr = newstr + str[i] + ",";
                }
            }
        } else {
            newstr = val + ",";
        }
       if(bHas==false) {
           
            newstr =newstr+ val + ",";
       }
        $("#hid_AID").val(newstr);
    }

    hid_AID是一个存放已经选择的ID的hidden

  • 相关阅读:
    [纯奇技淫巧] 特征根
    杂题20200528
    杂题20200509
    杂题20200419
    杂题20200415
    杂题20200407
    杂题20200314
    Educational Codeforces Round 83 简要题解
    一种简单的dp trick
    杂题20200304
  • 原文地址:https://www.cnblogs.com/weiying/p/weiying_2014_01_23.html
Copyright © 2020-2023  润新知