event listener

onClick

The onClick property is an event handler for processing click events on an element. When a user clicks on an element, a click event is raised. It fires after a mousedown and mouseup event.

syntax

target.onClick = functionRef;

You can also add an event directly on to a HTML element:

<div onClick="functionRef(event)">click here</div>

functionRef is a function name or function expression