Jquery javascript - How can I let users 'undo' their modifications?

Posted by Bill Zimmerman on Stack Overflow See other posts from Stack Overflow or by Bill Zimmerman
Published on 2010-04-24T21:54:12Z Indexed on 2010/04/24 22:13 UTC
Read the original article Hit count: 252

Filed under:
|
|

Hi, i have a basic jquery app that allows a user to edit and manipulate some lists on a page. What I would like to do is have a button 'restore original list' that the user can press to undo his modifications.

What is the best way to do this? I was thinking of just copying the DOM from the list down, and pasting it in a hidden element someplace else on the page. Is this the best way to do this?

I also noticed that jquery has a .data() function which I could use if I converted the data to an array and stored it this way. What are the advantages and disadvantages?

Also, I'm open to any suggestions people have if there is some method I haven't thought of.

Thanks for your help!

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript