0

How to toggle in JavaScript?

I want to toggle colors with one button on javascript, but I'm not really sure how. I need help... https://code.sololearn.com/WjEayTmv4vqn/?ref=app

12th May 2019, 5:41 AM
Ginfio
Ginfio - avatar
3 Antworten
+ 3
https://code.sololearn.com/WKhl0bADtMt1/?ref=app
12th May 2019, 6:14 AM
Gordon
Gordon - avatar
+ 1
Ethan McCoy, now can you make it shift back and forth between each color? Onclick make it turn green, onclick make it turn red, onclick green, onick, red.......
12th May 2019, 6:05 AM
Ginfio
Ginfio - avatar
0
https://code.sololearn.com/WNb9eWc0z5L9/?ref=app Your code works well, I just made the div visible.
12th May 2019, 6:02 AM
Ethan McCoy
Ethan McCoy - avatar