ミニロト抽選機

 

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>sample</title>
 <script type="text/javascript">
<!--
function suf() {
var nums = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31];
for(var i = 0; i < 31; i++) {
var n = Math.floor(Math.random() * 31);
var tmp = nums[i];
nums[i] = nums[n];
nums[n] = tmp;
}
for(i = 0; i < 6; i++) {
document.forms[0].elements["num" + i].value = nums[i];
}
}

-->
< /script>
< /head>
< body>
< form>
< p>ランダム抽選機</p>
< p>本数字</p>
< input name="num0">
< input name="num1">
< input name="num2">
< input name="num3">
< input name="num4">

< legend>ボーナス数字</legend>
< input name="num5" size="1">
< p>抽選</p>
< input type="button" value="抽選" onclick="suf();">
< input type="reset">
< /form>
< /body>
< /html>