Jquery 撤消对 DOM 的最后更改

发布于 2024-10-16 22:02:30 字数 83 浏览 9 评论 0原文

撤消对 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

北渚 2024-10-23 22:02:30

您可以先克隆容器,然后撤消只需清理容器并克隆克隆的 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文