Reputation: 3289
I am editing content in <div>
. Now I want to check whether the data in <div>
is edited or not and If it is edited then save it in session and return on refresh.
How can I check whether the data is edited or not and then save it in session?
Following is JS fiddle for Edit .
If more information is needed please do tell.
Thanks for the help.
Upvotes: 0
Views: 180
Reputation: 13151
One simple solution is
Save the div contents on click of edit.
data = $(this).siblings('.panel-title').html();
Compare the saved content & current content on click of done.
data != $(this).siblings('.panel-title').html()
If it's edited then simply store into the cookie or localstorage.
Something like this.
Upvotes: 1