Build, share, and learn JavaScript, CSS, and HTML with our online code editor. Discover web applications and hire talent from the world’s largest community of front end developers and designers.

頼まれ備忘録なので軽く。 30秒で読めますw JavaScriptでForm要素の値の取り方 getElementByIdで直接 form['hoge'].elements['piyo']とか:[ ]にはnameの値 hoge.piyoとか:nameの値でドットつなぎ 他にもいっぱいあるけど。 で、 <form action="" name="f"> <input type="text" name="v1" value="aaa" /> <input type="text" name="v2" value="bbb" /> </form> こういうHTMLがあって、各要素の`value`を操作したいとする。 // Case 1: OK var x = document.f.elements['v1']; x.value = "Nya"; // Case 2: NG var y = docu
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く