Which attribute is used to link an `<input>` element to a specific `<form>` if it's placed outside the form?
A
action B
for C
form D
target
Analysis & Theory
`form` attribute connects an input to a form using the form's ID.
What does the `name` attribute in an input field do?
A
Sets a default label B
Used as the key when sending form data C
Applies a CSS class D
Sets the input's display name
Analysis & Theory
`name` is required for the input data to be included in form submissions.
Which attribute defines the kind of data expected in an input field?
A
type B
name C
value D
data
Analysis & Theory
`type` specifies the type of input (e.g., text, email, password, number, etc.).
What is the purpose of the `value` attribute in a form input?
A
Sets a limit on characters B
Defines the placeholder text C
Specifies the default value of the input D
Labels the input
Analysis & Theory
`value` sets the initial value shown in the input field.
Which attribute prevents form submission if the input is empty?
A
checked B
disabled C
readonly D
required
Analysis & Theory
`required` ensures the field is not left blank before submission.
What does the `disabled` attribute do to an input field?
A
Makes it editable B
Removes its placeholder C
Prevents the user from interacting with it D
Validates it automatically
Analysis & Theory
`disabled` makes the input unclickable and skips it during form submission.
What is the use of the `readonly` attribute?
A
Hides the input B
Prevents editing but allows selection/copy C
Makes it required D
Clears its value
Analysis & Theory
`readonly` keeps the field visible and selectable but prevents editing.
Which attribute controls whether the browser should auto-fill the input?
A
placeholder B
autofill C
autocomplete D
default
Analysis & Theory
`autocomplete` enables or disables browser autofill for the input.
What does the `maxlength` attribute specify?
A
How many fields are in the form B
The maximum number of words C
The maximum number of characters allowed in the input D
The width of the input
Analysis & Theory
`maxlength` limits the number of characters a user can type into the input.
Which attribute provides hint text inside an input before typing begins?
A
title B
alt C
placeholder D
value
Analysis & Theory
`placeholder` shows a short hint to guide the user about what to enter.