Call a function when a button is clicked:

<button onclick="myFunction()">Click me</button>