Displaying change of content through parent
- by Mikhail
I have DHTML content inside a fieldset. This includes plain html, nested objects (even other fieldsets), and value change of input, select, and textarea objects.
I'd like to change the border of the fieldset if the contents have been changed.
The following works:
$('fieldset[name=qsfs127]').children('input').change(function(){
$(this).parent('fieldset').css({border:'1px solid red'});
})
This handles the input; I can extend it to select and textarea.
Questions:
How can I do the same for html changes?
Can all of this change-tracking be done by comparing current html() to stored one?
If yes for (2), will this handle cases of "undo"?
Edit: I have a button that ajax-uploads contents, and saves the changes. I then remove the border color