Created
October 23, 2013 10:49
-
-
Save chikoski/7116480 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<form> | |
<input type="text" id="input_a" placeholder="一つ目の文章"> | |
<input type="text" id="input_b" placeholder="二つ目の文章"> | |
<input type="button" id="btn_start" value="結合!"> | |
</form> | |
<div> | |
<p>結果</p> | |
<p id="output"></p> | |
</div> | |
</body> | |
</html> |
This file contains hidden or 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 concat = function(a, b){ | |
return a + " " + b; | |
}; | |
var calc = function(){ | |
var input_a = document.getElementById("input_a"); | |
var input_b = document.getElementById("input_b"); | |
var output = document.getElementById("output"); | |
var message = concat(input_a.value, input_b.value); | |
output.textContent = message; | |
}; | |
var btn = document.getElementById("btn_start"); | |
btn.onclick = calc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment