How to add event listeners?

I have created my plugin UI (panel) and it contains several buttons. Now I’m stuck at how to add a function to that button.
For example,
If I click on a button (which is defined inside inner html) it must call a function(). Where should I include event listeners? and where should I declare functions?

I will archive this since it seems to be a duplicate of How to add event listeners to my plugin code?