MY code is not woking please solve it(CHore door webpage)

HTML code:


<!DOCTYPE html>

<html>

  <head>

    <title>Chore Door!</title>

    <link href="./style.css" rel="stylesheet" type="text/css">

    <link href="https://fonts.googleapis.com/css?family=Work+Sans" rel="stylesheet" type="text/css">

     

  </head>

  <body>

    <div class="door-row">

      <img id="door1" src="https://content.codecademy.com/projects/chore-door/images/closed_door.svg">

      

       </div>

      <script type="text/javascript" src="script.js"></script>

  </body>

</html>

Css code:

body {

  background-color: #010165;

  margin: 0px;

}

#door1{

  cursor:pointer;

}

Js code:

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

let botDoorPath="https://content.codecademy.com/projects/chore-door/images/robot.svg";

doorImage1.onClick = () =>{

   doorImage1.src=botDoorPath;

}

looking at the documentation:

your have a “typo” (more like upper vs lowercase) issue.

onclick seems to be all lowercase letters, I would agree with you that cammelcase makes more sense, given on click is two words

2 Likes