Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

How to specify the type of button using HTML5 ?

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

To specify the button type in HTML5, we can use the HTML | <button> type Attribute. This attribute is used to specify the type of button. It specifies the type attribute of the <button> element. The default types of <button> elements can vary from browser to browser. 

Syntax:

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

Example:

HTML




<!DOCTYPE html> 
<html
    <head
        <title
            HTML button type Attribute 
        </title
    </head
      
    <body
        <h1>GeeksforGeeks</h1
          
        <h3>Specifying the Button type</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:

button type


My Personal Notes arrow_drop_up
Last Updated : 31 Mar, 2021
Like Article
Save Article
Similar Reads
Related Tutorials