The onclick event occurs when the user clicks the left mouse button on an object.
This example uses the event to trigger a function that returns the event's srcElement tagName and type.
Click on each of the following objects and anywhere else on this document and see what has been clicked.
What's been clicked:
© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.