Root: WRM Database > Information Technology > Programming Languages > JavaScript > Event Handlers > onClick > The onClick JavaScript Event Handler

The onClick JavaScript Event Handler

The onclick JavaScript event handler is easy to use. Event handlers are used to tell the browser what to do when an event occurs. In this case the event will be a mouse click. You can apply the onClick event handler to many html tags. For example, you could use the <p> tag. Here's how it would look:

function your_function() {
document.write("After Click. Include An HTML Page<br />Break");

<p onClick="your_function();return true">Before Click</p>