<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="jquery-1.9.1.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$('#Button1').click(function () {
//After和Before是将一个新的节点插入到已有节点的后面或者前面
$('p').after('<p>After Hello World</p>');
})
$('#Button2').click(function () {
$('p').before('<p>Before Hello World</p>');
})
$('#Button3').click(function () {
//insertAfter和insertBefore是对两个已有的节点进行操作。
$('p:first').insertAfter($('p:last'));
})
})
</script>
</head>
<body>
<p>Hello World</p>
<input id="Button1" type="button" value="After" />
<input id="Button2" type="button" value="Befor" />
<input id="Button3" type="button" value="Revert" />
</body>
</html>
<html xmlns=" http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src="jquery-1.9.1.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$('#Button1').click(function () {
//After和Before是将一个新的节点插入到已有节点的后面或者前面
$('p').after('<p>After Hello World</p>');
})
$('#Button2').click(function () {
$('p').before('<p>Before Hello World</p>');
})
$('#Button3').click(function () {
//insertAfter和insertBefore是对两个已有的节点进行操作。
$('p:first').insertAfter($('p:last'));
})
})
</script>
</head>
<body>
<p>Hello World</p>
<input id="Button1" type="button" value="After" />
<input id="Button2" type="button" value="Befor" />
<input id="Button3" type="button" value="Revert" />
</body>
</html>