I am adding an event listener to a button. In short, in the logic of that function, I want to be able to determine if the click came from a real human click (the default) or if I called it.
So I've got this now:
this.button.addEventListener("click", (e) =>
{e.stopPropagation()}, true);
And later on, I do this:
this.button.click();
I'd like to able to pass something from my .click() that indicates to the event listener that this was not a manual click from a real user. How can this be done?
I saw several other questions about using this to pass values, but in my case I want to pass the value on function call, not set it to a variable inside the this scope.