<html>
<head>
<title>随机数</title>
<script>
function random(){
var date = new Date();
var s = '';
s = ("0"+date.getMinutes()).slice(-2);
s += ("0"+date.getSeconds()).slice(-2);
s += ("0"+date.getMilliseconds()).slice(-2);
document.getElementById("rand").value = s;
}
</script>
</head>
<body>
<input type="text" name="rand" id="rand" disabled/>
<input type="button" value="生成" onclick="random()"/>
</body>
</html>