Form Fields
Text fields allow users to enter a single line of text.
index.html
- The
label
element is used to provide a label for the text field; - The
input
element is used to create the text field; - The
type
attribute specifies that this is a text field. You can settype="date"
,type="number"
etc.; - The
id
andname
attributes uniquely identify the field.
Radio buttons allow users to select a single option from a list of options.
index.html
The value
attribute specifies the value submitted with the form when a particular radio button is selected.
textarea
elements allow users to enter multiple lines of text.
index.html
This textarea
element would be displayed on the web page as a blank field where the user can type in a message. The rows
and cols
attributes are used to specify the size
of the textarea
in terms of the number of rows and columns.
Task
- Add a
"name"
field, which should be a simple text field (type="text"
). - Add a
<label>
field for the"email"
text field below. - Fill in the radio button below, similar to the one done above for the
male
option. - Create a radio button for the option
"other"
below, similar to the one done above for thefemale
option. Also, add a<label>
. - Add a submit button here.
Bedankt voor je feedback!
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.
Stel mij vragen over dit onderwerp
Vat dit hoofdstuk samen
Toon voorbeelden uit de praktijk
Awesome!
Completion rate improved to 3.45
Form Fields
Veeg om het menu te tonen
Text fields allow users to enter a single line of text.
index.html
- The
label
element is used to provide a label for the text field; - The
input
element is used to create the text field; - The
type
attribute specifies that this is a text field. You can settype="date"
,type="number"
etc.; - The
id
andname
attributes uniquely identify the field.
Radio buttons allow users to select a single option from a list of options.
index.html
The value
attribute specifies the value submitted with the form when a particular radio button is selected.
textarea
elements allow users to enter multiple lines of text.
index.html
This textarea
element would be displayed on the web page as a blank field where the user can type in a message. The rows
and cols
attributes are used to specify the size
of the textarea
in terms of the number of rows and columns.
Task
- Add a
"name"
field, which should be a simple text field (type="text"
). - Add a
<label>
field for the"email"
text field below. - Fill in the radio button below, similar to the one done above for the
male
option. - Create a radio button for the option
"other"
below, similar to the one done above for thefemale
option. Also, add a<label>
. - Add a submit button here.
Bedankt voor je feedback!