HTML <input type = "button">

Last Updated : 23 May, 2026

The HTML <input type="button"> element is used to create a clickable button in a webpage. It performs custom actions using JavaScript when clicked.

  • Used to create a clickable button for custom actions.
  • Created using <input type="button"> and commonly used with JavaScript.
  • Supports attributes like value, onclick, disabled, and name.

Syntax:

<input type="button"> 

Example: Demonstrate the use of the HTML <input type="button"> element.

html
<!--Driver Code Starts-->
<html>

<head>
    <title>
        HTML Input Type Button
    </title>
</head>

<!--Driver Code Ends-->

<body style="text-align:center;">
    <h2>HTML &lt;input type = "button"&gt;</h2>

    <form action="#">
        <label for="button">Click this Button</label>

        <input type="button" id="button" 
            onclick="send()" value="Click Here!">
    </form>
    
    <script>
        function send() {
            alert("Welcome to GeeksforGeeks");
        }
    </script>
</body>

<!--Driver Code Starts-->

</html>

<!--Driver Code Ends-->
Comment