--- id: 6145e6eeaa66c605eb087fe9 title: Step 30 challengeType: 0 dashedName: step-30 --- # --description-- Although not required for `label` elements with a nested `input`, it is still best-practice to explicitly link a `label` with its corresponding `input` element. Link the `label` elements with their corresponding `input` elements. # --hints-- You should give the first `label` a `for` attribute matching the `id` of its `input` element. ```js const htmlFor = document.querySelectorAll('ul.answers-list > li > label')?.[0]?.htmlFor; assert.notEmpty(htmlFor); assert.equal(htmlFor, document.querySelectorAll('ul.answers-list > li > label > input')?.[0]?.id); ``` You should give the second `label` a `for` attribute matching the `id` of its `input` element. ```js const htmlFor = document.querySelectorAll('ul.answers-list > li > label')?.[1]?.htmlFor; assert.notEmpty(htmlFor); assert.equal(htmlFor, document.querySelectorAll('ul.answers-list > li > label > input')?.[1]?.id); ``` You should give the third `label` a `for` attribute matching the `id` of its `input` element. ```js const htmlFor = document.querySelectorAll('ul.answers-list > li > label')?.[2]?.htmlFor; assert.notEmpty(htmlFor); assert.equal(htmlFor, document.querySelectorAll('ul.answers-list > li > label > input')?.[2]?.id); ``` You should give the fourth `label` a `for` attribute matching the `id` of its `input` element. ```js const htmlFor = document.querySelectorAll('ul.answers-list > li > label')?.[3]?.htmlFor; assert.notEmpty(htmlFor); assert.equal(htmlFor, document.querySelectorAll('ul.answers-list > li > label > input')?.[3]?.id); ``` # --seed-- ## --seed-contents-- ```html