<input id="rqn" readonly="" size="10" type="text"  />
<input onclick="rqn()" style="cursor: pointer;" type="button" value="1-70 的亂數" />


<script>Function rqn(){
document.getElementById("rqn").value=Math.floor(Math.random()*70+1);
}
rqn();
</script>


| 亂數 | Math.random() | button | readonly | onclick | input | function | script |

arrow
arrow
    全站熱搜

    c8cc168 發表在 痞客邦 留言(0) 人氣()