Hi Tim. You were right. That was the issue.
If i change the do every time with “do once”, the addevent gets triggered correctly and the removeevent works on the button click - which is what I wanted.

However, given that it only works with “do once”, I have to think of another way to check if the data stored is different than the data in the input. Theoretically, the do every time condition would have worked, because it would always check for that condition when it becomes true - the problem was that it was triggering it several times (or at least that’s what we assume given that do once works with removing the listener).

Can you suggest any other way to constantly verify if the data stored is different than the one in the input, and if yes, to trigger the javascript?

Thanks Tim!