Skip to content

Instantly share code, notes, and snippets.

@chikoski
Created October 31, 2012 06:20
Show Gist options
  • Save chikoski/3985345 to your computer and use it in GitHub Desktop.
Save chikoski/3985345 to your computer and use it in GitHub Desktop.
テキスト入力欄へ入力された値を取得して、アラートウィンドウへ表示するプログラム
<input type="text" id="text1">
<input type="button" value="Click me!" onclick="readTextInput()">
<script>
function readTextInput(){
var text = document.getElementById("text1");
var inputValue = text.value;
window.alert(inputValue);
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment