+ 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 ??
3 Respostas
+ 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).
+ 5
You can use HTML5 new color input for this purpose.
Here is an example:
https://code.sololearn.com/WnS9H5hlk3wm/?ref=app
+ 3
You can use HTML5 new color input for this purpose.
Here is an example:
https://code.sololearn.com/WnS9H5hlk3wm/?ref=app