onClick is an easy to use Javascript event handler. Event handlers are used to tell the browser what to do when an event occurs. In this case, onClick is the event. Fairly simple.
-After the onClick Javascript event handler, we enclose our entire javascript code in double quotation marks.
-We use the built-in javascript alert method to open an alert box. Since we are inside double quotes, we use single quotes around our 'Hello!' message.
-We return false so the browser won't use the href tag. If we return true the browser window would go to the url in the href tag.
The onClick Javascript event handler is incredibly useful in that it can be used in more than just link tags. It can used in submit buttons, radio buttons, reset buttons as well as checkboxes.
There are examples of these below and links to even more information about onClick.