Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jquery Undo last change to DOM

Tags:

undo

jquery

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.

like image 999
Hussein Avatar asked Feb 11 '11 01:02

Hussein


1 Answers

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

like image 91
andres descalzo Avatar answered Oct 13 '22 01:10

andres descalzo