On clicking click Me Button body background color,h1 color and rgb demontration of the color should be shown and if background is dark h1 background should be white and and body background is light h1 background should be black.
Hosted project
26 lines of code
Challenges Faced
As i have done it before so it was not much of a challenge but i really liked background white and black switching situation
https://codeekta28.github.io/color-flipper/
Github Source File
https://github.com/codeekta28/color-flipper.git
javascript used
- DOM
- function
- textContent
- Destructuring of Array
- if-else
- Event
Lines Of Code26 lines of code
Challenges Faced
As i have done it before so it was not much of a challenge but i really liked background white and black switching situation
New Things Learned or refreshed
We can return two values in function in the form of Array and then use it by destructuring and you can select entire body using document.body
Biggest Takeaway
functions can return more than 1 values using array and use desturture to assign value inside array to variable
Comments
Post a Comment