insertBefore()
![](https://img.haomeiwen.com/i2655931/2435fe55e22200c9.png)
![](https://img.haomeiwen.com/i2655931/498d21e23a402980.png)
insertAfter()
![](https://img.haomeiwen.com/i2655931/8501e40eef63438f.png)
appendTo() : 原生appendChild
![](https://img.haomeiwen.com/i2655931/c73e8bd7d395f92a.png)
![](https://img.haomeiwen.com/i2655931/e7b4f20bad7c5033.png)
prependTo()
![](https://img.haomeiwen.com/i2655931/bb871ab8d20011e9.png)
![](https://img.haomeiwen.com/i2655931/21fc1abf04377b0f.png)
和上面方法区别: 后续操作变了, 可以用下面的相反的方法
before()
![](https://img.haomeiwen.com/i2655931/2813261da1a43150.png)
![](https://img.haomeiwen.com/i2655931/4c7aa6d53a9010df.png)
after()
append()
prepend()
insertBefore()
insertAfter()
appendTo() : 原生appendChild
prependTo()
和上面方法区别: 后续操作变了, 可以用下面的相反的方法
before()
after()
append()
prepend()
本文标题: 10-jQuery方法之DOM操作
本文链接:https://www.haomeiwen.com/subject/lwqxottx.html
网友评论