The Wayback Machine - https://web.archive.org/web/20231210210926/https://www.geeksforgeeks.org/how-to-create-a-clickable-button-in-html/
Open In App
Related Articles

How to create a clickable button in HTML ?

Improve Article
Improve
Save Article
Save
Like Article
Like

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
Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Last Updated : 18 Jun, 2020
Like Article
Save Article
Previous
Next
Similar Reads
Complete Tutorials