夜の歌

プログラミング、音楽、本について緩く書いていきます。

はまった。(10月22日)

まずはJavaScript

function ss(){
	for(var i = 0; i < 25; i++){
	    document.getElementById("i").value = 8; 
    }
}


続いてHTML

<body style="text-align:center" onload="ss()">

<input type="button" id="1" value="1">
<input type="button" id="2" value="2">
<input type="button" id="3" value="3">
<input type="button" id="4" value="4">
<input type="button" id="5" value="5"><br/>
<input type="button" id="6" value="6">
<input type="button" id="7" value="7">
<input type="button" id="8" value="8">
<input type="button" id="9" value="9">
<input type="button" id="10" value="10"><br />
<input type="button" id="11" value="11">
<input type="button" id="12" value="12">
<input type="button" id="13" value="13">
<input type="button" id="14" value="14">
<input type="button" id="15" value="15"><br />
<input type="button" id="16" value="16">
<input type="button" id="17" value="17">
<input type="button" id="18" value="18">
<input type="button" id="19" value="19">
<input type="button" id="20" value="20"><br />
<input type="button" id="21" value="21">
<input type="button" id="22" value="22">
<input type="button" id="23" value="23">
<input type="button" id="24" value="24">
<input type="button" id="25" value="25">

</body>

JavaScriptの、document.getElementById().valueのIDに変数iを入れて、ボタン全部の数字を8にするって処理を作りたかった。しかし、動かない。。

なんか、idとして正しく認識されていないからだよな。うーん。調べよう。

さらにエミュレータでもハマった。。英語読めんとヤバい。ちょいちょいやろう。

よし、寝る。おやすみなさい。