append()、prepend()、after()、before()都支持多个参数
1、append()
append() 该方法是在子元素的尾部插入内容
<body>
<ul>
<li>111</li>
<li>222</li>
<li>333</li>
</ul>
</body>
</html>
<script>
$("ul").append("<li>444</li>","<li>555</li>")
</script>
2、prepend()
prepend()方法在子元素的头部插入内容
3、before()
before() 方法在同级元素的前面插入内容
<body>
<ul>
<li>111</li>
<li>222</li>
<li>333</li>
</ul>
</body>
</html>
<script>
$("ul").before("<ul><li>000</li></ul>")
</script>
4、after()
after() 在同级元素的后面插入内容
5、insertAfter()
该方法用于已有元素,这些元素会被从当前位置移走,然后被添加到被选元素之后。(可以用于对调元素)
6、insertBefore()
添加到被选元素之前(可以用于对调元素)
7、replaceWith()
用参数(标签)替换目标标签