onclick Attribute

By: Dusty Arlia
Published on Monday, July 15, 2013, 06:30 PM
Last Updated on Tuesday, July 14, 2015 at 12:46 AM
Total Updates: 2

The onclick HTML attribute is an event attribute. The onclick attribute fires on a mouse click on the element. Here is the basic syntax

<[element] onclick="[script]">

The value of this attribute is always a script (usually JavaScript, the default).