zoukankan      html  css  js  c++  java
  • js 随机选择下拉列表项

    function selRandom(){
    var objSelectd;
    var countOption;
    var indexSel;
    objSelectd = document.getElementById("id");
    countOption = objSelectd.length;
    indexSel = Math.floor(Math.random()*countOption+1);
    objSelectd.value = objSelectd.options[indexSel].value;
    }

    ---------------------------------------------------------------

    AUTHOR:testerZH

    用途:菜鸟的个人学习记录,有不对的地方请指正!谢谢!

    出处:http://www.cnblogs.com/testerZH/

  • 相关阅读:
    Bessie Goes Moo
    小P的强力值
    Max Flow
    约瑟夫
    Moocryption
    杂务
    排行榜
    银行贷款
    轰炸
    Contaminated Milk
  • 原文地址:https://www.cnblogs.com/testerZH/p/2340224.html
Copyright © 2011-2022 走看看