Hi, my self Ravi Vishwakarma. I have completed my studies at SPICBB Varanasi. now I completed MCA with 76% form Veer Bahadur Singh Purvanchal University Jaunpur.
SWE @ MindStick | Software Engineer | Web Developer | .Net Developer | Web Developer | Backend Engineer | .NET Core Developer
The <input> tag in HTML is used to create various types of form elements that allow users to enter and submit data. The
<input> tag is versatile and supports many types of
inputs by using the type attribute to define the specific kind of input element you want to create.
Basic Syntax
<input type="text">
Common Types of Input Elements
Text Input (type="text"): Used for single-line text input.
id: Specifies a unique identifier for the input element.
name: Specifies the name of the input element, which is used to identify the data when the form is submitted.
value: Specifies the default value of the input element.
placeholder: Provides a hint to the user about what to enter in the input field.
required: Specifies that the input field must be filled out before submitting the form.
readonly: Specifies that the input field is read-only.
disabled: Disables the input field.
maxlength: Specifies the maximum number of characters allowed in the input field.
min and max: Specifies the minimum and maximum values for numeric inputs.
The <input> tag is a fundamental element in HTML forms, allowing users to enter data in
various formats. By utilizing the different type attributes and combining them with other form elements, you can create complex and functional forms to collect user input.
Ravi Vishwakarma
05-Jun-2024The
<input>
tag in HTML is used to create various types of form elements that allow users to enter and submit data. The<input>
tag is versatile and supports many types of inputs by using thetype
attribute to define the specific kind of input element you want to create.Basic Syntax
Common Types of Input Elements
Text Input (
type="text"
): Used for single-line text input.Password Input (
type="password"
): Used for entering passwords; characters are masked.Email Input (
type="email"
): Used for entering email addresses.Number Input (
type="number"
): Used for entering numerical values.Date Input (
type="date"
): Used for entering dates.Checkbox (
type="checkbox"
): Used for creating checkboxes.Radio Button (
type="radio"
): Used for creating radio buttons.Submit Button (
type="submit"
): Used to submit the form data to the server.Button (
type="button"
): Used to create a clickable button that does not submit the form.File Input (
type="file"
): Used for uploading files.Attributes of
<input>
TagThe
<input>
tag is a fundamental element in HTML forms, allowing users to enter data in various formats. By utilizing the differenttype
attributes and combining them with other form elements, you can create complex and functional forms to collect user input.Read Also - HTML5 form attributes