I have a textarea. It has default undo/redo functionality, either with ctrl-z/y or by right-clicking and choosing copy/paste.
I want to create an undo/redo button and trigger the native undo/redo. I'm not sure how to trigger this. (Was surprised that my users don't know ctrl-z)
You can use document.execCommand
to achieve this functionallity. It is used by some HTML-editors.
execCommand compatibility
And by now, this is deprecated, and should not be used.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With