<button> Tag in HTML

The <button> tag is used to create a clickable button in an HTML document. This tag can be used within forms, as well as in standalone places to trigger actions such as submitting forms or triggering JavaScript functions.

Key Points on <button> Tag:

Syntax of <button> Tag:

Syntax Example

<button>Button Text</button>

Example of <button> Tag in HTML:

This example demonstrates how to use the <button> tag to create a button with a click action.

Code Example


        <button type="button" onclick="alert('Button clicked!')">Click Me</button>
                

Output

Button Types:

The <button> tag is a powerful and flexible element. It allows you to easily create buttons in forms or in standalone contexts that can trigger specific actions like JavaScript functions, form submissions, or resets.