mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix(curriculum): inconsistent value attribute between steps 9 to 12 in superhero application form (#60804)
This commit is contained in:
+16
-7
@@ -19,51 +19,60 @@ Inside your `select` element, you need to create options for the user to choose
|
||||
| `Ancient artifact discovery` |
|
||||
| `Other` |
|
||||
|
||||
The first option (`Select one`) should have an empty string as its `value` attribute (i.e., `value=''`). This acts as a placeholder in the UI.
|
||||
|
||||
# --hints--
|
||||
|
||||
Your should create the first `option` element with the text `Select one` inside your `select` element.
|
||||
You should create the first `option` element with the text `Select one` inside your `select` element.
|
||||
|
||||
```js
|
||||
const optionEls = document?.querySelectorAll("select > option");
|
||||
assert.equal(optionEls[0]?.textContent, "Select one");
|
||||
```
|
||||
|
||||
Your should create a second `option` element with the text `Bitten by a strange creature` inside your `select` element.
|
||||
You should give the first `option` element a `value` attribute with an empty string.
|
||||
|
||||
```js
|
||||
const optionEls = document?.querySelectorAll("select > option");
|
||||
assert.equal(optionEls[0]?.getAttribute('value'), '');
|
||||
```
|
||||
|
||||
You should create a second `option` element with the text `Bitten by a strange creature` inside your `select` element.
|
||||
|
||||
```js
|
||||
const optionEls = document?.querySelectorAll("select > option");
|
||||
assert.equal(optionEls[1]?.textContent, "Bitten by a strange creature");
|
||||
```
|
||||
|
||||
Your should create a third `option` element with the text `Radioactive exposure` inside your `select` element.
|
||||
You should create a third `option` element with the text `Radioactive exposure` inside your `select` element.
|
||||
|
||||
```js
|
||||
const optionEls = document?.querySelectorAll("select > option");
|
||||
assert.equal(optionEls[2]?.textContent, "Radioactive exposure");
|
||||
```
|
||||
|
||||
Your should create a fourth `option` element with the text `Science experiment` inside your `select` element.
|
||||
You should create a fourth `option` element with the text `Science experiment` inside your `select` element.
|
||||
|
||||
```js
|
||||
const optionEls = document?.querySelectorAll("select > option");
|
||||
assert.equal(optionEls[3]?.textContent, "Science experiment");
|
||||
```
|
||||
|
||||
Your should create a fifth `option` element with the text `Alien heritage` inside your `select` element.
|
||||
You should create a fifth `option` element with the text `Alien heritage` inside your `select` element.
|
||||
|
||||
```js
|
||||
const optionEls = document?.querySelectorAll("select > option");
|
||||
assert.equal(optionEls[4]?.textContent, "Alien heritage");
|
||||
```
|
||||
|
||||
Your should create a sixth `option` element with the text `Ancient artifact discovery` inside your `select` element.
|
||||
You should create a sixth `option` element with the text `Ancient artifact discovery` inside your `select` element.
|
||||
|
||||
```js
|
||||
const optionEls = document?.querySelectorAll("select > option");
|
||||
assert.equal(optionEls[5]?.textContent, "Ancient artifact discovery");
|
||||
```
|
||||
|
||||
Your should create a seventh `option` element with the text `Other` inside your `select` element.
|
||||
You should create a seventh `option` element with the text `Other` inside your `select` element.
|
||||
|
||||
```js
|
||||
const optionEls = document?.querySelectorAll("select > option");
|
||||
|
||||
+1
-1
@@ -219,7 +219,7 @@ export const SuperheroForm = () => {
|
||||
<label className='section column'>
|
||||
How did you get your powers?
|
||||
<select>
|
||||
<option>
|
||||
<option value=''>
|
||||
Select one
|
||||
</option>
|
||||
--fcc-editable-region--
|
||||
|
||||
Reference in New Issue
Block a user