I've created a basic Survey Form using HTML, CSS.
- In the
h1
tag I've usedid="title"
for displaying the title. - In the
p
tag I've usedid="description"
for a short explanation. - In the
form
tag I've usedid="survey-form"
. - Inside the form element I've used the following id attributes:
id="name"
to enter the name.id="email"
to enter the email. If the entered email is not formatted correctly. There will'be an HTML5 validation error.id="number"
to enter the age. If someone enters non-numbers in the number input, there will'be an HTML5 validation error.
- For the name, email, and number input fields inside the form there is corresponding labels that describe the purpose of each field with the following ids:
id="name-label"
,id="email-label"
andid="number-label"
. - Inside the form element, there is an option from a dropdown that has a corresponding
id="dropdown"
. - Inside the form element, I've used a
name
attribute. - Inside the form element, I've used a
value
attribute, through which we can select several fields from a series of checkboxes. - Inside the form element there is a button with
id="submit"
to submit all the inputs.