Can't change background-image in js | SoloLearn: Learn to code for FREE!

+2

Can't change background-image in js

https://code.sololearn.com/WGAcf9EbUxx3/?ref=app

5/25/2020 6:52:42 PM

Сергей Куликов

4 Answers

New Answer

+3

Right will be: var button = document.getElementById("playPauseButton");

+2

Thank you all for your help.

+1

In my code, I need to change the background image of the 'play' button with it's 'onclick' event. The console says it can't read property style of null. What is wrong in my code? Please, help me to correct my code and make it work.

+1

Try adding this Сергей Куликов amigo var playPauseButton = "playPauseButton" or Make playPauseButton to "playPauseButton"