Trigger onclick on "Page Code" or from "Backend"

How can I execute/trigger onClick of a button from Page Code or from Backend?

My button

is connected to a Custom Code for re-trigger a third party code. Thats why I am finding a way to trigger onClick from Page Code or from Backend.

I solved it by manipulating the DOM with MutationObserver.