There's a couple of ways to add a click handler, but the method we'll use is to include an
attribute in the HTML
<button onclick="DoMyThing()">
The effect is to
call a Javascript function called
DoMyThing, whenever the button is clicked.
A couple of important things to note:
- You need the brackets after the function name, because we want the function to actually be executed
- You need the quotes around the call to DoMyThing()
Try clicking the button. It still doesn't work because we haven't defined that function yet.