Last active
August 29, 2015 14:07
-
-
Save yuu-nkjm/67db00d1cb4ef5da5adb 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>例1</h2> | |
<p>以下のp要素に書かれたテキストを読み取ります.</p> | |
<p id="input_text">出力されるテキスト→<br>foobar<br>foobar</p> | |
<p>読み取ったテキストを以下に書き込みます.</p> | |
<p id="output_area"></p> | |
<input type="button" id="button1" value="htmlの読み込み,書き込み"> | |
<script> | |
$(document).ready(function(){ | |
$("#button1").on("click", function(){ | |
var txt=$("#input_text").html(); | |
$("#output_area").html(txt); | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment