Piano key

nextTwo.hidden = true;

nextThree.hidden = true;

startOver.hidden= true;

why can’t use style attribute to access hidden property of css.

We need more context, here. Please post a link to the exercise, as well as your code.

https://www.codecademy.com/paths/web-development/tracks/build-interactive-websites/modules/dom-javascript-events/projects/piano-keys at a guess.

The lines of code you’ve written aren’t accessing any CSS at all. Rather, you’re setting the hidden attribute of the element itself.

There is no hidden property in CSS, it’s visibility. Either way, you don’t need that to achieve the goal here - setting the hidden attribute works just fine.

1 Like