--- id: 6145e6eeaa66c605eb087fe9 title: Step 30 challengeType: 0 dashedName: step-30 --- # --description-- Sebbene non sia richiesto per elementi `label` con un `input` nidificato, รจ comunque consigliabile collegare esplicitamente un elemento `label` con il suo elemento `input`. Collega gli elementi `label` ai loro elementi `input` corrispondenti. # --hints-- Dovresti assegnare al primo elemento `label` un attributo `for` che corrisponde all'`id` del suo elemento `input`. ```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); ``` Dovresti assegnare al secondo elemento `label` un attributo `for` che corrisponde all'`id` del suo elemento `input`. ```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); ``` Dovresti assegnare al terzo elemento `label` un attributo `for` che corrisponde all'`id` del suo elemento `input`. ```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); ``` Dovresti assegnare al quarto elemento `label` un attributo `for` che corrisponde all'`id` del suo elemento `input`. ```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