Triggering a button with JavaScript

Hi, I’m trying to use Toolbox to trigger a workflow (via pressing a button with JS code), but no success.

I’m following this solution:
document.getElementById(“id-name”).getElementsByTagName(“input”)[0].click();

just changin the ïd-name" for the name I gave to my button but it does not do anything. I’m not versed in JS syntax.

I took this solution from here Is there a way to trigger a picture upload through a button or icon instead of picture uploader?

This was made to trigger a picture upload though mine is just for a regular button.

Any advice? Probably a problem with my syntax.