Doors Exercise: Door1 Null Element

I am stuck at the ChoreDoor exercise, choreDoor

I don’t think I am doing anything wrong, please help me I tried all.

Screen Shot 2020-05-07 at 10.56.19 PM|690x314

You may want to review this:

I don’t see the error. :S

You’re using this.src. Is that at all in the lesson about onClick?

Tried both ways, and If you look in the console the problem its that door1 is returning a null, I don’t know how to fix it. css is fine html is fine js is fine.


Can we see it please?

1 Like

Here I made a video:

<!DOCTYPE html>
    <title>Chore Door!</title>
       <script src="script.js"></script>
    <link href="./style.css" rel="stylesheet" type="text/css">
    <link href="" rel="stylesheet" type="text/css">

<div class="door-row"><img id="door1" src="" ></div>

let doorImage1 = document.getElementById("door1");

const botDoorPath = "";

doorImage1.onclick = () => {
  doorImage1.src = botDoorPath;

Try reviewing task #6.


There’s a reason the <script></script> tag should be placed where the instructions specify. You’ve seen the outcome. Why do you suppose that is?

1 Like

Thank you! I got this task checked by the system as if it was right, this is why I did not look there. Thank you again :slight_smile:

1 Like

You’re welcome. Do you understand why the location of the <script></script> tag makes a difference?

Also, in this project, you have to mark the tasks off as complete when you finish them. It’s possible that when you click on the instruction panel to scroll down, that the click marks a task as complete. (I accidentally uncheck tasks all the time doing just that. :smile:)