JS代码
function yzm(){
var str
= "";
for(var i
=0;i
<6;i
++){
var code
= rand(48,122);
if((code
>=58&&code
<=64)||(code
>=91&&code
<=96)){
i
--;
}
else{
str
+= String
.fromCharCode(code
);
}
}
return str
;
}
function $id(id
){
return document
.getElementById(id
);
}
function rand(m
,n
){
return m
+parseInt(Math
.random()*(n
-m
+1));
}
$id("yz").innerHTML
= yzm();
$id("btn").onclick = function(){
$id("yz").innerHTML
= yzm();
}
转载请注明原文地址:https://tech.qufami.com/read-615.html