textInput Event or use
Manually keep track of all changes made to the textareas by writing the contents to an array each time it changes. Read the pre-last item from the array when clicking the undo button and remove its last item. Maybe add some logic to undo whole words instead of single chars each time the undo button is clicked.
I’ve created a simple tag template builder for xml, however, I didn’t know why there is no automatic undo redo feature (ctrl+z) for the added tags.
Here is a live sample: (press Run >> to activate it)
Please note: there is undo redo function for text that was typed manually, but not for added text from the buttons above. My guess is maybe because those added tags are like “built in” feature that the system doesn’t just detect.