Current Events > I have a question about javascript and background color

Topic List
Page List: 1
LastTomorrow
11/27/17 10:06:11 AM
#1:


I'm told that the webpage I'm making is suppose to have a form with the users name and age. Have a Submit button that when clicked should prompt the user their favorite color meaning change the background to the color of their choosing. Have an alert that tells them their favorite color was applied and on the second line their age. Have an event click button that will execute the function.
---
Waffle waffle waffle
... Copied to Clipboard!
ChromaticAngel
11/27/17 10:21:40 AM
#2:


What's the question?
---
... Copied to Clipboard!
LastTomorrow
11/27/17 10:28:03 AM
#3:


How to change the background color when the person puts down their preferred color. Basically prompt the color
---
Waffle waffle waffle
... Copied to Clipboard!
ChromaticAngel
11/27/17 10:32:36 AM
#4:


LastTomorrow posted...
How to change the background color when the person puts down their preferred color. Basically prompt the color

I would use angular and bind the css background color element but I have no idea what you're requirements are / if you're allowed to do that.
---
... Copied to Clipboard!
IllegalAlien
11/27/17 10:35:05 AM
#5:


Using vanilla JS all you need to do is give a limited prompt of colors maybe in a dropdown list. Then use the selection and map it to the hex code for the color.

Even better, don't limit their color choices but present a color wheel.
---
"Never argue with an idiot, they drag you down to their level, then beat you with experience."
... Copied to Clipboard!
LastTomorrow
11/27/17 10:38:59 AM
#6:


Okay
---
Waffle waffle waffle
... Copied to Clipboard!
Topic List
Page List: 1