Piano Keys project

The Piano Keys project fails to work for me.
Here is my code -

I am not sure where I am going wrong.
Any help pinpointing the problem would be appreciated.
The color on the keys change which is good.
But the line buttons do not work.

I am probably missing something. Please help.

There are a lot of event listeners. Can you isolate the ones that are not working and trace through that scenario?

1 Like

Line 76 of your JS file you have:

document.getElementByID('word-three ').innerHTML = 'BIRTH';

There’s an extra space in that ID. Do you see it? That should fix something, but like @mtf said, a lot could be going on. Fix that and see what other errors show up!


Also in line 50 you have another typo:

newTwo.onclick = function(){

that newTwo should be nextTwo right?


A post was split to a new topic: Piano Project Aside

<div class='keynote'>C</div>

Found this a bit among all the sections.

@irlfede Thank you very much Sir.
Yes, the extra space and the typo in the name (it should be nextTwo) resolved the problem.
I went through each line of code before reporting it on the forum.
Compared my code with that on the video.
But somehow I missed both the typos.
Actually, the space did not really matter, but the typo in the variable name matters.
Thanks again for taking time and going through the code.



Happy a could help! And please don’t feel bad that you didn’t catch the error. Sometimes we need help and fresh eyes see things that we cannot. It’s normal :smiley:

1 Like