<button onclick="alert('Boo!');">Click me</button>
Here the onclick event calls the javascript alert function. alert('Boo!')
Click me
<a href="#" onclick="alert('Boo!');">Click me</a>
Because onclick = " " is an attribute of the button element we have to use ' ' (single quotes)