Door Not Opening : error: Uncaught TypeError: Cannot set property 'onclick' of null

I’ve been working on the Chore Door Project and can’t seem to figure out why the door won’t open. I’ve watched the tutorial video and still can’t seem to detect what’s wrong with my code. Thank you in advance for the help!
Door was opening at step 10 when it was single.

I ran the code on another compiling platform the error was ‘error: Uncaught TypeError: Cannot set property ‘onclick’ of null’

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

    <div class='door-row'>
      <img class='door-frame' id='#door1' src=''>
      <img class='door-frame' id='#door2' src=''>
      <img class='door-frame' id='#door3' src=''>
  <script type="text/javascript" src="script.js"></script>

let d= document;
let doorImage1 = d.getElementById('door1');
let doorImage2 = d.getElementById('door2');
let doorImage3 = d.getElementById('door3');
let botDoorPath = '';
let beachDoorPath = '';
let spaceDoorPath = '';
doorImage1.onclick = () => {
  doorImage1.src = botDoorPath;
doorImage2.onclick = () => {
  doorImage2.src = beachDoorPath;
doorImage3.onclick = () => {
  doorImage3.src = spaceDoorPath;

I’ve tried other solutions to this including ‘defer’, calling script after body etc

Hello, @corepro41625, and welcome to the forums.

Looking at your html, I don’t see elements with id’s that match those specified above.

Also, you may want to review instruction #6 regarding the placement of the
<script></script> element.

1 Like

Thank you the problem was with the id. Such a silly mistake and this gave me a lesson for sure.

tags are working fine below the body tags.

Thank you