--- id: 6145e8b5080a5f06bb0223d0 title: Step 31 challengeType: 0 dashedName: step-31 --- # --description-- Give the `label` elements text such that the `input` comes before the text. Then, give the `input` elements a `value` matching the text. The text should either be `True` or `False`. # --hints-- You should give the first `label` element text content. ```js assert.notEmpty(document.querySelectorAll('ul.answers-list > li > label')?.[0]?.textContent?.trim()); ``` You should give the second `label` element text content. ```js assert.notEmpty(document.querySelectorAll('ul.answers-list > li > label')?.[1]?.textContent?.trim()); ``` You should give the third `label` element text content. ```js assert.notEmpty(document.querySelectorAll('ul.answers-list > li > label')?.[2]?.textContent?.trim()); ``` You should give the fourth `label` element text content. ```js assert.notEmpty(document.querySelectorAll('ul.answers-list > li > label')?.[3]?.textContent?.trim()); ``` You should place the first `label` text content after the `input` element. ```js assert.match(document.querySelectorAll('ul.answers-list > li > label')?.[0]?.innerHTML, />[\s\S]+[a-zA-Z]/); ``` You should place the second `label` text content after the `input` element. ```js assert.match(document.querySelectorAll('ul.answers-list > li > label')?.[1]?.innerHTML, />[\s\S]+[a-zA-Z]/); ``` You should place the third `label` text content after the `input` element. ```js assert.match(document.querySelectorAll('ul.answers-list > li > label')?.[2]?.innerHTML, />[\s\S]+[a-zA-Z]/); ``` You should place the fourth `label` text content after the `input` element. ```js assert.match(document.querySelectorAll('ul.answers-list > li > label')?.[3]?.innerHTML, />[\s\S]+[a-zA-Z]/); ``` You should give the first `label` the text `True` or `False`. ```js assert.include(['True', 'False'], document.querySelectorAll('ul.answers-list > li > label')?.[0]?.textContent?.trim()); ``` You should give the second `label` the text `True`. ```js const l = (n) => document.querySelectorAll('ul.answers-list > li > label')?.[n]?.textContent?.trim(); assert(l(0) === 'False' ? l(1) === 'True' : true); ``` You should give the second `label` the text `False`. ```js const l = (n) => document.querySelectorAll('ul.answers-list > li > label')?.[n]?.textContent?.trim(); assert(l(0) === 'True' ? l(1) === 'False' : true); ``` You should give the third `label` the text `True` or `False`. ```js assert.include(['True', 'False'], document.querySelectorAll('ul.answers-list > li > label')?.[2]?.textContent?.trim()); ``` You should give the fourth `label` the text `True`. ```js const l = (n) => document.querySelectorAll('ul.answers-list > li > label')?.[n]?.textContent?.trim(); assert(l(2) === 'False' ? l(3) === 'True' : true); ``` You should give the fourth `label` the text `False`. ```js const l = (n) => document.querySelectorAll('ul.answers-list > li > label')?.[n]?.textContent?.trim(); assert(l(2) === 'True' ? l(3) === 'False' : true); ``` You should give the first `input` a `value` matching the `label` text content. ```js assert.equal(document.querySelectorAll('ul.answers-list > li > label')?.[0]?.textContent?.trim()?.toLowerCase(), document.querySelectorAll('ul.answers-list > li > label > input')?.[0]?.value?.toLowerCase()); ``` You should give the second `input` a `value` matching the `label` text content. ```js assert.equal(document.querySelectorAll('ul.answers-list > li > label')?.[1]?.textContent?.trim()?.toLowerCase(), document.querySelectorAll('ul.answers-list > li > label > input')?.[1]?.value?.toLowerCase()); ``` You should give the third `input` a `value` matching the `label` text content. ```js assert.equal(document.querySelectorAll('ul.answers-list > li > label')?.[2]?.textContent?.trim()?.toLowerCase(), document.querySelectorAll('ul.answers-list > li > label > input')?.[2]?.value?.toLowerCase()); ``` You should give the fourth `input` a `value` matching the `label` text content. ```js assert.equal(document.querySelectorAll('ul.answers-list > li > label')?.[3]?.textContent?.trim()?.toLowerCase(), document.querySelectorAll('ul.answers-list > li > label > input')?.[3]?.value?.toLowerCase()); ``` # --seed-- ## --seed-contents-- ```html Accessibility Quiz

HTML/CSS Quiz

Student Info

HTML

1

The legend element represents a caption for the content of its parent fieldset element --fcc-editable-region--

2

A label element nesting an input element is required to have a for attribute with the same value as the input's id
--fcc-editable-region--

CSS

``` ```css body { background: #f5f6f7; color: #1b1b32; font-family: Helvetica; margin: 0; } header { width: 100%; height: 50px; background-color: #1b1b32; display: flex; } #logo { width: max(100px, 18vw); background-color: #0a0a23; aspect-ratio: 35 / 4; padding: 0.4rem; } h1 { color: #f1be32; font-size: min(5vw, 1.2em); } nav { width: 50%; max-width: 300px; height: 50px; } nav > ul { display: flex; justify-content: space-evenly; } h1, h2 { font-family: Verdana, Tahoma; } h2 { border-bottom: 4px solid #dfdfe2; } .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; } ```