Math.floor((x+1) * 10000000)

解决方案 »

  1.   

    function init(){ 
    x=Math.random();
    x=Math.floor(x * 100000000)
    if(x<9999999)
      init();
    document.forms[0].elements[0].value=x;
    timer1=setTimeout("init()",1000);}
      

  2.   

    <SCRIPT LANGUAGE="JavaScript">
    document.write(rand(11111111,99999999));
    function rand(lowerbound,upperbound) {
    return parseInt((upperbound-lowerbound+1)*Math.random()+lowerbound);
    }
    </SCRIPT>
      

  3.   

    最小是多少把这句改成多少就是啦
    if(x<9999999)
      

  4.   

    我想要带字母的  
    例如 3k4A6o9FF8ui9875ww
      

  5.   

    <SCRIPT LANGUAGE="VBScript">
    function rPassword(length)
    Dim aKey,sReturn,i
    aKey = Array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","_")
    For i = 1 To length
    sReturn = sReturn & aKey(rand(0,Ubound(aKey)))
    Next
    rPassword = sReturn
    end functionfunction rand(iStart,iEnd)
    Randomize
    rand = Int((iEnd-iStart+1)*Rnd+iStart)
    end functiondocument.write rPassword(16)
    </SCRIPT>