textarea: button to trigger native undo/redo
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
链接地址: http://www.djcxy.com/p/73256.html上一篇: 我们可以使用RTTI按名称查找函数/过程并运行它们吗?
下一篇: textarea:按钮触发原生撤销/重做