Activate contextmenu with button click

I’m in need to activate a context menu when a html button is pressed. Any ideas on how to make it work. I’ve got it to work on the right-mouse click, but I want to replace with a left-mouse click. Thanks for any ideas and help…

Hello
Do you need this menu for this button or it will be something different?

Anyway you can trigger menu.showContextMenu(x, y) by button onclick event