<html>
<head>
</head>
<script>
function code(){
var Num="";
for(var i=0;i<6;i++){
Num+=Math.floor(Math.random()*10);
}
document.getElementById("codes").value=Num;
}
</script>
<body>
<input type="text" name="code" id="codes">
<input type="botton" value="yanzhengma" onclick="code()">
</body>
</html>