STEP 1 · LEARN How it works Explicitly connect a label to a required text input. Semantic structure should describe meaning, not visual appearance.
<form><label for="name">Name</label><input id="name" type="text" name="name" required></form>The label gives the field a visible name. Its for attribute points to the input’s exact id, name identifies the submitted value, and required marks the field as mandatory.
<form><label>Name</label><input name="name"></form>The label text is next to the input but is not connected through for and id. The explicit type and required state are also missing.
EXPECTED RESULT A form with an explicitly connected label and a text input carrying id, name and required.
STEP 2 · APPLY Your exercise Complete the example. Explicitly connect a label to a required text input.
Code Result
index.html HTML
Exercise code
STEP 4 · CHECK
What needs to pass 0% not checked
○ The text input has id, name and required. ○ The input has a connected label.
Check exercise✓ Show a hint
Explain the solution logic+ Use the same identifier in label for and input id, then add type="text", name and required to the input.