Skip to content
geeksforgeeks
  • Courses
    • DSA to Development
    • Get IBM Certification
    • Newly Launched!
      • Master Django Framework
      • Become AWS Certified
    • For Working Professionals
      • Interview 101: DSA & System Design
      • Data Science Training Program
      • JAVA Backend Development (Live)
      • DevOps Engineering (LIVE)
      • Data Structures & Algorithms in Python
    • For Students
      • Placement Preparation Course
      • Data Science (Live)
      • Data Structure & Algorithm-Self Paced (C++/JAVA)
      • Master Competitive Programming (Live)
      • Full Stack Development with React & Node JS (Live)
    • Full Stack Development
    • Data Science Program
    • All Courses
  • Tutorials
    • Data Structures & Algorithms
    • ML & Data Science
    • Interview Corner
    • Programming Languages
    • Web Development
    • CS Subjects
    • DevOps And Linux
    • School Learning
  • Practice
    • Build your AI Agent
    • GfG 160
    • Problem of the Day
    • Practice Coding Problems
    • GfG SDE Sheet
  • Contests
    • Accenture Hackathon (Ending Soon!)
    • GfG Weekly [Rated Contest]
    • Job-A-Thon Hiring Challenge
    • All Contests and Events
  • HTML Tutorial
  • HTML Exercises
  • HTML Tags
  • HTML Attributes
  • Global Attributes
  • Event Attributes
  • HTML Interview Questions
  • HTML DOM
  • DOM Audio/Video
  • HTML 5
  • HTML Examples
  • Color Picker
  • A to Z Guide
  • HTML Formatter
Open In App
Next Article:
HTML <input type="tel">
Next article icon

HTML <input type=”submit”>

Last Updated : 09 Dec, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

HTML <input type=”submit”> is used to define a button that submits form data to the server when clicked. It is commonly used in various forms, such as email forms, contact forms, or login forms, to send the data for processing.

Note: The form handler is defined in the action attribute of the form.

Syntax

<input type="submit"> 

Attributes

AttributeDescription
valueSpecifies the text displayed on the submit button.
nameDefines a name for the submit button, useful for identifying the button in the form data.
disabledDisables the submit button, preventing the form from being submitted.
formSpecifies the form that the submit button belongs to when not inside a form tag.
formactionDefines the URL where the form data will be sent for processing when the button is clicked.
formenctypeSpecifies how the form data should be encoded when submitting it to the server.
formmethodSpecifies the HTTP method (GET or POST) to use when sending form data.
formtargetSpecifies where to display the response after submitting the form (e.g., in a new window).
autofocusAutomatically focuses the submit button when the page loads.
formnovalidatePrevents form validation when submitting the form using this submit button.

Example: We are using the HTML <input type=”submit”> to create a submit button for a form. When clicked, it submits the form data (username and password) to the server for processing.

html
<!DOCTYPE html> <html>  <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

HTML-Input-Type-Submit example

Supported Browsers

  • Google Chrome
  • Edge
  • Mozilla
  • Safari
  • Opera

Next Article
HTML <input type="tel">

M

manaschhabra2
Improve
Article Tags :
  • HTML
  • Web Technologies
  • HTML-Attributes

Similar Reads

  • HTML <input type = "button">
    The HTML <input type="button"> element creates a clickable button that can be customized with text or an image. It does not have any default behavior but can be used to perform actions using JavaScript. It makes versatile for various interactive purposes in web forms and applications. Syntax
    1 min read
  • HTML <input type="checkbox">
    The HTML <input type="checkbox"> creates a checkbox input element. It displays as a square box, checked when activated. Checkboxes enable users to select one or more options from a limited set of choices. Syntax <input type="checkbox"> Example: In this example, we will demonstrate using
    1 min read
  • HTML <input type="color">
    The HTML <input type="color"> element is used to define a color picker. The value should be a seven-character hexadecimal notation representing RGB values in hexadecimal format. Its default value is #000000 (black). Syntax<input type="color"> Example: In this example, we will demonstrate
    1 min read
  • HTML <input type="date">
    The HTML <input type="date"> element provides a date picker interface for selecting dates. It allows users to input dates using a calendar widget, ensuring standardized date input across different browsers and devices.  Syntax<input type="date">Example: In this example, the HTML <inpu
    1 min read
  • HTML <input type="email">
    The HTML <input type="email"> is used to create an input field specifically for email addresses. It automatically validates the input to ensure it follows the correct email format. Adding the "multiple" attribute allows the user to input multiple email addresses, separated by commas. Syntax
    1 min read
  • HTML <input type="file">
    The HTML <input type="file"> element is used to create a file input box in forms. It allows users to browse and select files to upload from the devices. When the form is submitted, the selected file(s) can be uploaded to the server. Syntax<input type="file"> Example: In this example, we
    1 min read
  • HTML <input type="hidden">
    The HTML <input type="hidden"> element defines a hidden input field. Hidden fields store data that are not visible or modifiable by users when they submit a form. They are useful for including data that needs to be sent with the form but does not need to be displayed. Syntax<input type="hid
    1 min read
  • HTML <input type="image">
    The HTML <input type="image"> element defines an image as a submit button within a form. When the image is clicked, the form is submitted, similar to a regular submit button. It allows for more visually appealing form submissions, as the image can serve as the button instead of a plain text or
    2 min read
  • HTML <input type="month">
    The HTML <input type="month"> element creates a month picker, allowing users to select a specific month and year without specifying a day. It provides a standardized way to input month-based data to enhance user experience. Syntax<input type="month"> Example: This example demonstrate the
    1 min read
  • HTML <input type="number">
    The HTML <input type="number"> element creates an input field for entering numeric values. It allows for easy input of numbers with optional restrictions such as minimum, maximum, and step values. This element enhances form validation by ensuring only numeric input is accepted, improving user
    1 min read
geeksforgeeks-footer-logo
Corporate & Communications Address:
A-143, 7th Floor, Sovereign Corporate Tower, Sector- 136, Noida, Uttar Pradesh (201305)
Registered Address:
K 061, Tower K, Gulshan Vivante Apartment, Sector 137, Noida, Gautam Buddh Nagar, Uttar Pradesh, 201305
GFG App on Play Store GFG App on App Store
Advertise with us
  • Company
  • About Us
  • Legal
  • Privacy Policy
  • In Media
  • Contact Us
  • Advertise with us
  • GFG Corporate Solution
  • Placement Training Program
  • Languages
  • Python
  • Java
  • C++
  • PHP
  • GoLang
  • SQL
  • R Language
  • Android Tutorial
  • Tutorials Archive
  • DSA
  • Data Structures
  • Algorithms
  • DSA for Beginners
  • Basic DSA Problems
  • DSA Roadmap
  • Top 100 DSA Interview Problems
  • DSA Roadmap by Sandeep Jain
  • All Cheat Sheets
  • Data Science & ML
  • Data Science With Python
  • Data Science For Beginner
  • Machine Learning
  • ML Maths
  • Data Visualisation
  • Pandas
  • NumPy
  • NLP
  • Deep Learning
  • Web Technologies
  • HTML
  • CSS
  • JavaScript
  • TypeScript
  • ReactJS
  • NextJS
  • Bootstrap
  • Web Design
  • Python Tutorial
  • Python Programming Examples
  • Python Projects
  • Python Tkinter
  • Python Web Scraping
  • OpenCV Tutorial
  • Python Interview Question
  • Django
  • Computer Science
  • Operating Systems
  • Computer Network
  • Database Management System
  • Software Engineering
  • Digital Logic Design
  • Engineering Maths
  • Software Development
  • Software Testing
  • DevOps
  • Git
  • Linux
  • AWS
  • Docker
  • Kubernetes
  • Azure
  • GCP
  • DevOps Roadmap
  • System Design
  • High Level Design
  • Low Level Design
  • UML Diagrams
  • Interview Guide
  • Design Patterns
  • OOAD
  • System Design Bootcamp
  • Interview Questions
  • Inteview Preparation
  • Competitive Programming
  • Top DS or Algo for CP
  • Company-Wise Recruitment Process
  • Company-Wise Preparation
  • Aptitude Preparation
  • Puzzles
  • School Subjects
  • Mathematics
  • Physics
  • Chemistry
  • Biology
  • Social Science
  • English Grammar
  • Commerce
  • World GK
  • GeeksforGeeks Videos
  • DSA
  • Python
  • Java
  • C++
  • Web Development
  • Data Science
  • CS Subjects
@GeeksforGeeks, Sanchhaya Education Private Limited, All rights reserved
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy
Lightbox
Improvement
Suggest Changes
Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal.
geeksforgeeks-suggest-icon
Create Improvement
Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all.
geeksforgeeks-improvement-icon
Suggest Changes
min 4 words, max Words Limit:1000

Thank You!

Your suggestions are valuable to us.

What kind of Experience do you want to share?

Interview Experiences
Admission Experiences
Career Journeys
Work Experiences
Campus Experiences
Competitive Exam Experiences