You need to put quotes around the call to `button_click()` in your input's `onCLick` (and you don't need the semi-colon): <input type="checkbox" onClick="button_click()"> In general, for _any_ attribute of an HTML element, you have to enclose the value in quotes.