<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<script type="text/javascript">
var str = '';
var n = 0;
for(var i=0;i<4;i++){
var x = Math.random();
if(x<0.5){
if(x<0.25)
n=String.fromCharCode(Math.ceil(Math.random() * 25)+65);
else
n = String.fromCharCode(Math.ceil(Math.random() * 25)+97)
}else{
n = parseInt(Math.random()*10)
}
str += n;
}
document.write(str);
</script>
</head>
<body>
</body>
</html>
原声JS生成包括数字和字母的验证码
最新推荐文章于 2020-10-27 19:18:43 发布