JS怎样利用按钮实现在Text框所输入过的内容做撤消和重做的操作解决办法

JS怎样利用按钮实现在Text框所输入过的内容做撤消和重做的操作
JS怎样利用按钮实现在Text框所输入过的内容做撤消和重做的操作

撤消是指上一步,不是reset按钮,重做是下一步

------解决方案--------------------
<input type= "text ">
<input type= "button " value= "undo " onclick= "document.execCommand( 'Undo '); ">
<input type= "button " value= "redo " onclick= "document.execCommand( 'Redo '); ">