Connecting Labels to Form Controls
A visible label identifies a control and can be associated using matching for and id values. Provide clear instructions and describe validation errors in text near the relevant field. Do not use place
What you’ll learn
Learn to apply connecting labels to form controls in a practical situation.
Explanation
A visible label identifies a control and can be associated using matching for and id values. Provide clear instructions and describe validation errors in text near the relevant field. Do not use placeholder text as the only label.
Label ដែលមើលឃើញប្រាប់ថាត្រូវបញ្ចូលអ្វី។ ភ្ជាប់ label និង input ដោយ for និង id ដូចគ្នា ហើយបង្ហាញកំហុសជាអត្ថបទច្បាស់។
Worked example
<label for="email">Email</label><input id="email" name="email" type="email">
Practice
- How are the label and input associated in the example?
- Apply the idea to an example of your own and explain your choice.
Answers and guidance
Show answers / បង្ហាញចម្លើយ
- The label’s for value matches the input’s id.
- Answers vary. Compare your example with the explanation and check each step.
Quick recap
A visible label identifies a control and can be associated using matching for and id values.