mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-04-30 16:01:14 -04:00
fix(curriculum): element references in Storytelling App (#60369)
This commit is contained in:
@@ -7,7 +7,7 @@ dashedName: step-2
|
||||
|
||||
# --description--
|
||||
|
||||
Create a `main` element with a class of `story-container`. Inside the `story-container`, create a `div` with a class of `btn-container`.
|
||||
Create a `main` element with a class of `story-container`. Inside the `.story-container` element, create a `div` with a class of `btn-container`.
|
||||
|
||||
# --hints--
|
||||
|
||||
@@ -17,7 +17,7 @@ You should have a `main` element with a class of `story-container`.
|
||||
assert.exists(document.querySelector('main.story-container'));
|
||||
```
|
||||
|
||||
Inside the `story-container` element, you should have a `div` with a class of `btn-container`.
|
||||
Inside the `.story-container` element, you should have a `div` with a class of `btn-container`.
|
||||
|
||||
```js
|
||||
assert.exists(document.querySelector('main.story-container div.btn-container'));
|
||||
|
||||
@@ -11,7 +11,7 @@ Inside the `.btn-container` , create three buttons for each type of story. Give
|
||||
|
||||
# --hints--
|
||||
|
||||
Inside the `btn-container` div, you should have three buttons.
|
||||
Inside the `.btn-container` element, you should have three buttons.
|
||||
|
||||
```js
|
||||
assert.lengthOf(document.querySelectorAll('.btn-container > button') ,3);
|
||||
|
||||
@@ -17,7 +17,7 @@ You should create a `script` element.
|
||||
assert.lengthOf(document.querySelectorAll('script'), 3);
|
||||
```
|
||||
|
||||
Your `script` element should have an `src` attribute set to `script.js`.
|
||||
Your `script` element should have a `src` attribute set to `script.js`.
|
||||
|
||||
```js
|
||||
const script = document.querySelector("script[data-src$='script.js']");
|
||||
|
||||
@@ -17,7 +17,7 @@ You should have a `storyContainer` variable.
|
||||
assert.isDefined(storyContainer);
|
||||
```
|
||||
|
||||
You should select the `div` with the class `story-container` using the `querySelector` method and store it in the `storyContainer` variable.
|
||||
You should select the `.story-container` element using the `querySelector` method and store it in the `storyContainer` variable.
|
||||
|
||||
```js
|
||||
assert.deepEqual(storyContainer, document.querySelector(".story-container"));
|
||||
|
||||
@@ -18,7 +18,7 @@ assert.isDefined(scaryStoryBtn);
|
||||
assert.deepEqual(scaryStoryBtn, document.getElementById("scary-btn"));
|
||||
```
|
||||
|
||||
You should select the `#funny-btn` button using the `getElementById` method and store it in the `funnyStoryBtn` variable.
|
||||
You should select the `#funny-btn` button using the `getElementById` method and store it in the `funnyStoryBtn` variable.
|
||||
|
||||
```js
|
||||
assert.isDefined(funnyStoryBtn);
|
||||
|
||||
Reference in New Issue
Block a user