Skip to content
Related Articles

Related Articles

Improve Article

How to create a clickable button in HTML ?

  • Last Updated : 18 Jun, 2020

In this article, we will create a Button by using the <Button> Element in the Document.
It is used to submit the content. The images and text content can use inside a button tag.

Syntax:

<button type = "button">

Example: Using HTML <button> type Attribute




<!DOCTYPE html> 
<html
    <head
        <title>
            How to create a clickable button?
              </title
    </head
      
    <body
      <center>
        <p>
            <h2>
                GeeksForGeeks
        </h2>
        </p
        <h2>
            HTML: How to create a clickable button?
  
        </h2>
          
        <!-- button tag starts from here -->
        <button type = "button" onclick
            "alert('Welcome to GeeksforGeeks')"
            Click Here 
        </button
        <!-- button tag ends here -->
          
    </body
</html>                     

Output:

Supported Browsers are listed below:

  • Google Chrome
  • Internet Explorer
  • Firefox
  • Opera
  • Safari

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 :