Skip to content

Commit 2ccba11

Browse files
committed
'Random Background Color Changer' docs: README.me add description step 5 (variation_2)
1 parent 343d93a commit 2ccba11

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,23 @@ Debugging is the process of going through your code, finding any issues, and fix
66

77
In this project, you will help CamperBot build a random background color changer and help them find and fix errors.
88

9+
<details>
10+
<summary>
11+
<h4>Description of the Tasks</h4>
12+
</summary>
13+
<details>
14+
<summary>
15+
<h5>Step 5</h5>
16+
</summary>
17+
<p>
18+
CamperBot has created a new variable called <code>bgHexCodeSpanElement</code> to store the reference to the <code>span</code> element with the <code>id</code> of <code>bg-hex-code</code>. However, when they try to log that variable to the console, they get <code>null</code>
19+
<code>null</code> is a special value in JavaScript that represents the absence of a value. This can happen when you try to access a property of an object that doesn't exist
20+
In this case, CamperBot is not passing in the correct selector to the <code>document.querySelector</code> method
21+
Fix the <code>document.querySelector("bg-hex-code")</code> line so that it correctly selects the element with the <code>id</code> of <code>bg-hex-code</code>.
22+
</p>
23+
</details>
24+
</details>
25+
926
#### preview
1027

1128
![preview 'Random Background Color Changer step 4'](https://github.com/AndriiKot/JS__Random_Background_Color_Changer__freeCodeCamp/blob/main/preview/step1.png)

0 commit comments

Comments
 (0)