有沒有要改進的地方
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Math </title>
<script type="text/javascript">
function math(){
? ? var math = Math.round(Math.random()*10);
? ? ?document.getElementById('txt2').value = math;
}
</script>
</head>
<body>
? ? <input type="text" name="text" id="txt2">
? ? <input name="button" type=button value="刷新" onclick="math()"/>
</body>
</html>
2019-09-21
改進一下?? document.getElementById('txt2').value = Math.round(Math.random()*10)
2021-03-24
不大于10的整數還是能包括10