+ 8

How can we make a website which will change color as per user's perception??

How can we develop a website which will first ask for your favourite color and then will change the background color accordingly ??

17th Mar 2018, 12:53 PM
Arushi Singhania
Arushi Singhania - avatar
3 Answers
+ 11
document.getElementById(id).style.property = value After asking for the color using the 'prompt()' method, use the statement above. Replace 'id' with the id of your background element, replace 'property' with the attribute of that element you wanted to change ('color' in this case), and 'value' with the value you want to change that style to (the input from the user, in this case).
17th Mar 2018, 12:58 PM
apex137
apex137 - avatar
+ 5
You can use HTML5 new color input for this purpose. Here is an example: https://code.sololearn.com/WnS9H5hlk3wm/?ref=app
18th Mar 2018, 10:37 AM
777
777 - avatar
+ 3
You can use HTML5 new color input for this purpose. Here is an example: https://code.sololearn.com/WnS9H5hlk3wm/?ref=app
19th Mar 2018, 1:26 AM
Benjamin Joseph Cadsby
Benjamin Joseph Cadsby - avatar