Last active
December 16, 2015 09:28
-
-
Save dameninngenn/5412713 to your computer and use it in GitHub Desktop.
決まった値をフォームにスコーンと入れるやつ。ブックマークレットにしたりして使う。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var list = { | |
text : { | |
"key" : "バリュ〜〜" | |
}, | |
checkbox : { | |
"hai" : 1 | |
} | |
}; | |
for (var key in list.text) { | |
var elm = document.getElementsByName(key); | |
elm.item(0).value=list.text[key]; | |
} | |
for (var key in list.checkbox) { | |
var elm = document.getElementsByName(key); | |
elm.item(0).checked=list.checkbox[key]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment