VOOZH about

URL: https://www.geeksforgeeks.org/html/html-input-form-attribute/

⇱ HTML <input> form Attribute - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML <input> form Attribute

Last Updated : 25 May, 2026

The form attribute is used to associate an <input> element with a specific <form> element. It allows the input field to be connected to a form even if it is placed outside the form tag.

  • Links an input element to a form using the form’s id value.
  • Allows input fields to exist outside the <form> element while still being submitted with the form.
  • Helps in creating flexible and well-structured form layouts

Syntax:

<input form="form_id">

Attribute Value: The form attribute contains a single value called form_id, which specifies the id of the <form> element the input belongs to.

Example: Illustrates the use of form attribute in <input> element. 

Comment
Article Tags: