JAVASCRIPT FOR BEGINNERS: How to toggle background color of a div using an HTML button

preview_player
Показать описание
#toggleBackgroundColor #addEventListener #getElementById
When the user presses the button the Javascript function is called and the background color toggles between aqua and black.

👉 My Javascript For Beginners PlayList

👉 My Javascript Shorts Tutorials PlayList

👉 My HTML For Beginners Shorts Tutorials Playlist

👉 My Javascript Arrays Shorts Tutorials PlayList

👉 Javascript Spread Operator Shorts Tutorials Playlist

👉 My Javascript Test Tutorials Playlist

👉 My Javascript Clean Code Shorts Tutorials PlayList

👉 My HTML Shorts Tutorials PlayList

👉 My Jquery Shorts Tutorials PlayList

👉 My Bootstrap Shorts Tutorials PlayList

👉 My CSS Shorts Tutorials PlayList

👉 My Visual Studio Code Shorts Tutorials PlayList

👉 Table (HTML, CSS, Bootstrap, Javascript, jQuery) Shorts Tutorials Playlist

one minute coder web site:
Рекомендации по теме
Комментарии
Автор

great tutorial! thank you. can someone explain why the if statement uses == 'aqua' but the code uses = 'black' and = 'aqua'! In other words, why does the if statement require ' == ' but the code blocks only require ' = '. I'm confused about this and wonder how anyone keeps the two straight

shannonstumpf
join shbcf.ru