function writeDocument(variable) {
document.write(variable + "<br/>");
}
writeDocument("最大值最小值----------");
writeDocument("最大值:"+Math.max(1,3,9,13,19,139));
writeDocument("最小值:"+Math.min(1,3,9,13,19,139));
writeDocument("生成4位数随机验证码");
function generateVerifyCode(length)
{
var strLetterNumber="012345678929817284abcdefghijklmnopqrlstuvwxzyzs62981uwgjsabdasoo1w"
var code="";
for(var i=0;i<length;i++)
{
var randomNumber=Math.floor(Math.random()*strLetterNumber.length);
code =code +strLetterNumber.charAt(randomNumber);
}
return code;
}
writeDocument(generateVerifyCode(4));
writeDocument(generateVerifyCode(5));
writeDocument(generateVerifyCode(6));
function generateVerifyCode1(length)
{
var strLetterNumber="0123456789"
var code="";
for(var i=0;i<length;i++)
{
var randomNumber=Math.floor(Math.random()*strLetterNumber.length);
code =code +strLetterNumber.charAt(randomNumber);
}
return code;
}
writeDocument("生成随机的颜色 rgb(255,255,255)")
writeDocument('随机颜色'+generateVerifyCode1(3)+","+generateVerifyCode1(3)+","+generateVerifyCode1(3));
console