October 22, 2024
Chicago 12, Melborne City, USA
javascript

Is there a native javascript API to manipulate the undo stack of HTML elements?


I created a contenteditable element in my page and during some events I update it by replacing the innerHTML. When I do that, the undo stack gets reset.

I found some recommendations to use the executeCommand api, but the MDN doc says it’s deprecated and does not offer an alternative.

  • Is there a way to update the innerHTML while keeping the undo stack intact?
  • Alternatively, is there a way to manipulate the undo stack of an element using javascript?



You need to sign in to view this answers

Leave feedback about this

  • Quality
  • Price
  • Service

PROS

+
Add Field

CONS

+
Add Field
Choose Image
Choose Video