Is it possible to check the possibility of pressing ctr + z in Js? that is, if for example you changed something on the page, you can cancel it by pressing ctr + z, how can you track what is in that buffer undo? Here is an example.
<button id="undo" title="ctrl + Z" >Undo</button><button id="redo" title="ctrl + Y" disabled>Redo</button> <div class="phones" contenteditable="true"><span>8 (925) 505-55-55</span> <br /><span>8 (925) 505-55-55</span></div>
When changing the text, I would like the buttons to change the activity