How to execute function call (js) when clicking on the link, button or any other element. A long time ago I was taught to write the call in the onclick(), but I've seen a few other variants of this action.
So I want to know how did the most right to do it?