Disclosure: Your support helps keep the site running! We earn a referral fee for some of the services we recommend on this page. Learn more
- Attribute of
- How To Use The HTML Tag
- What does
- Runs a script when a button is clicked.
onClick attribute is an event handler that instructs the browser to run a script when the visitor clicks a button.
Browser Support for onClick