When I reached task 10 where I had to use onclick, the door didn’t open.
I thought it was an issue with my code so I checked what others had done and I had done the same. I still checked and copied and pasted the whole project from someone to see if the issue was with my code but still, it didn’t work.
I thought it may be an issue caused Chrome so I tried on Mozilla and Edge as well but still, the doors won’t open.
Anyone has any idea of what the issue could be? Thank you!
His links are actually right on. He links to index.js in his HTML. However in the Codecademy sandbox the Javascript file is called script.js as stated in the assignment.
All JavaScript logic will be written within the script.js file but in order to have that logic interact with the HTML, you first need to establish a connection between the script.js page and the index.html. In the index.html page, create a <script> element directly above the closing </body> tag. Inside the opening <script> tag, set the type as "text/javascript" and the src as "script.js". Then immediately close the element with a </script> tag.
So as I said small mistakes are easily missed. I suggest you backtrack to your original code and check the links. Then start building again from there.