Jquery 撤消对 DOM 的最后更改
撤消对 Dom 所做的最后更改的最简单方法是什么。假设我附加了一个图像或 div,或者我们对任何元素进行了更改,并且我想撤消影响 dom 的最后一件事。
What is the easiest way to undo last change done to Dom. let's say i appended an image or div or we made changes to any of the elements and i want to undo the last thing that affected the dom.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以先克隆容器,然后撤消只需清理容器并克隆克隆的 dom。
http://api.jquery.com/clone/
http://api.jquery.com/empty
You can clone previously the container and then to undo just have to clean the container and put the dom cloned.
http://api.jquery.com/clone/
http://api.jquery.com/empty