Open In App

HTML | <button> type Attribute

The <button> type attribute is used to specify the type of button. It specifies the type attribute of <button> element. The default types of <button> element can vary from browser to browser.

Syntax:



<button type="button|submit|reset">

Attribute Values:

Example: 






<!DOCTYPE html>
<html>
    <head>
        <title>
            HTML button type Attribute
        </title>
    </head>
     
    <body>
        <h1>GeeksforGeeks</h1>
          
        <h3>HTML button type Attribute</h3>
         
        <form action="#" method="get">
            Username: <input type="text" name="uname">
             
            <br><br>
             
            Password: <input type="password" name="pwd">
             
            <br><br>
             
            <button type="submit" value="submit">
                Submit
            </button>
             
            <button type="reset" value="reset">
                Reset
            </button>
        </form>
    </body>
</html>                                            

Output:

  

Supported Browsers: The browser supported by HTML <button> type attribute are listed below:


Article Tags :