Skip to content
Related Articles

Related Articles

Improve Article

How to specify the type of button using HTML5 ?

  • Last Updated : 31 Mar, 2021
Geek Week

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

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.




My Personal Notes arrow_drop_up
Recommended Articles
Page :