<!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 () {
$('p').after('<p>After Hello World</p>');
})
$('#Button2').click(function () {
$('p').before('<p>Before Hello World</p>');
})
$('#Button3').click(function () {
$('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="Before" />
<input id="Button3" type="button" value="Revert" />
</body>
</html>
![](https://img2024.cnblogs.com/blog/35695/202408/35695-20240826070647288-243310440.jpg)