Home » HTML Button onClick

HTML Button onClick

by Online Tutorials Library

HTML <Button onClick=” “>

The Html <button onclick=” “> is an event attribute, which executes a script when the button is clicked. This attribute is supported by all browsers. It is also used to call a function when the button is clicked.

Syntax:

Examples:

Example 1: Following example describes how to use the button tag:

Test it Now

Output:

HTML Button onClick

Browser Support

Element chrome browser Chrome ie browser IE firefox browser Firefox opera browser Opera safari browser Safari
<onClick> Yes Yes Yes Yes Yes

Next TopicHTML Checkbox Tag

You may also like