SOURCE

document.write(Math.floor(36.198)+"<br/>");
document.write("生成随机验证码<br/>");
function getYZM(length){
    var strValue="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    var code="";
    for(var i=0;i<length;++i){
        var randomIndex=Math.floor(Math.random()*strValue.length);
        code+=strValue.charAt(randomIndex);
    }
    return code;
}
document.write(getYZM(4)+"<br/>");
document.write(getYZM(5)+"<br/>");
document.write(getYZM(6)+"<br/>");




console 命令行工具 X clear

                    
>
console