<script>loadFlg = 0;
function start_click() {
if(loadFlg == 0){
loadFlg = 1;
change();
}
else {
loadFlg = 0;
}
}
function change() {
var items = document.getElementsByName("numberhere");
for( var i = 0; i < items.length; i++ ) {
var li = items[i];
li.innerHTML = Math.floor(Math.random() * 9);
}
if(loadFlg == 1) {
setTimeout("change()", 10);
}
}</script>
<div name="numberhere">0</div>
<input onclick="start_click()" type="button" value="start" />
Aucun commentaire:
Enregistrer un commentaire