HTML <input type=”submit”>

The HTML <input type=”submit”> element defines a button that submits form data to a server. When a user clicks on this button, the form is submitted, and the data entered in the form fields is sent to the server for processing. This element is commonly used as a form’s primary submit button.

Syntax

<input type="submit"> 

Example: This example demonstrates the use of HTML <input type=”submit”> element.

html
<!DOCTYPE html>
<html>

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

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

    <form action="#">
        <label for="uname">User Name:</label>
        <input type="text" id="uname">
        <br><br>

        <label for="pwd">Password:</label>
        <input type="password" id="pwd">
        <br><br>

        <input type="submit" value="Submit">
    </form>
</body>

</html>

Output

Supported Browsers

  • Chrome 1
  • Edge 12
  • Firefox 1
  • Opera 15
  • Safari 1

Contact Us