Created
May 19, 2010 23:39
-
-
Save memememomo/407001 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
<html> | |
<head> | |
<title>test</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(function(){ | |
var pfirst = $("p#first").html(); | |
alert(pfirst); | |
$("p#first").prepend("<strong>要素内先頭</strong>"); | |
$("p#first").append("<strong>要素内最後</strong>"); | |
pfirst = $("p#first").html(); | |
alert(pfirst); | |
var wrap = $("div#wrap").html(); | |
alert(wrap); | |
$("p#first").before("<strong>要素の前</strong>"); | |
$("p#first").after("<strong>要素の後</strong>"); | |
wrap = $("div#wrap").html(); | |
alert(wrap); | |
}); | |
</script> | |
<body> | |
<div id="wrap"> | |
<p id="first">変更前</p> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment