Last active
August 29, 2015 14:07
-
-
Save yuu-nkjm/8c2ef8c0a51ef3b3946f 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8" /> | |
<script src="http://code.jquery.com/jquery-1.11.1.min.js"></script> | |
</head> | |
<body> | |
<h2>例2</h2> | |
<div>入力欄:<input type="text" id="input1" value="入力文字列"></div> | |
<div>出力欄:<input type="text" id="output1" value=""></div> | |
<div><input type="button" id="button2" value="value属性の読み込み,書き込み"></div> | |
<script> | |
$(document).ready(function(){ | |
$("#button2").on("click", function(){ | |
var txt=$("#input1").val(); | |
$("#output1").val(txt); | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment