Answer the question
In order to leave comments, you need to log in
What is the label tag in html for?
The tag <label>
establishes an association between a specific label, which is usually text, and a form element ( <input>, <select>, <textarea>
).
Such a link is necessary to change the values of the form elements when the mouse cursor clicks on the text.
Is there an example for the second sentence? I do not understand what text should be clicked and what should happen? What values should the form elements change to?
Answer the question
In order to leave comments, you need to log in
in simple language, briefly:
each label has an attribute for, which must match the id of the input or selector
, if this attribute matches, then the user does not need to aim at the checkbox, just click on the text enclosed in the label tags, and the value of the checkbox will change to the opposite
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question