activeElement or event.relatedTarget alternatives

I am trying to run a click event before a blur event but the blur event stops the click on the button being run - or seems to be anyway.
I want to clear a text input box on blur unless the blur is a result of clicking on the save button. However the blur event of the text box runs and then the click of the save button isn’t recorded. Is there a way round this or is something causing it? I have read that using activeElement or event.relatedTarget would allow me to identify if the blur was caused by the save button being clicked but neither appear to be available in Wix.

I have worked around this by adding a setTimeout to the blur so that it waits to see if the button should be run before running the blur function but if there was another better solution that would be good