Best practice to call a function from a button-link?

Best practice to call a function from a button-link?