References

Collection of references for web development.

HTML onclick event

Description

Execute JavaScript code when the user clicks the mouse button on the element.

Example

<div onclick="this.style.backgroundColor = 'orange'">Click me!</div>