Code:
<!DOCTYPE html>
<html>
<head>
<title>mahh...</title>
<meta charset="UTF-8">
<style> #p {font-size:30px;} </style>
</head>
<body>
<p>Choose your favorite color:</p>
<form>
<select id="select" onchange="foo()">
<option>Colors</option>
<option value="red">RED</option>
<option value="blue">BLUE</option>
<option value="green">GEEEN</option>
</select>
</form>
<p id="p"></p>
<script>
function foo() {
var color = document.getElementById("select").value;
document.getElementById("p").innerHTML = "Your favorite color is: " + color;
}
</script>
</body>
</html>
How to have body background same as selected color ?
E.g. If you select the red color, body background should be red...
Fucking DOM!