Custom javascript functionality (undo/redo) not working for rich text editor

Hi all!

I’m using a rich text editor in bubble, where users can write and edit text. For better UX, I wanted to implement undo/redo functionality. To do so, I found a jsfiddle doing just what I need:
https://jsfiddle.net/FMSsL/

My plan was to load the js and implement two buttons for undo/redo functionality.
So I load the file in the HTML page header, expose the attribute ID’s of the rich text editor and the buttons but it doesnt seem to work.

Am I missing something? Has somebody any idea of what I am missing?

Thanks so much!

When you use a plugin like rich text editor and then assign an id, the id is actually assigned to the parent element and not the input within, you would have to use javascript to access the input. I actually just looked and it seems the input’s default id is “richtext-editor-0”. Replace anywhere in the javascript where you reference an id of “input” with this and the code should work.