-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscript.js
29 lines (23 loc) · 795 Bytes
/
script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
var colorx=document.querySelector(".color1");
var colorz=document.getElementById("color2");
var css=document.querySelector("h3");
var body=document.querySelector("body");
function dynamo(){
body.style.background="linear-gradient(to right,"+colorx.value+", "+colorz.value+")";
css.textContent=body.style.background+";";
};
colorx.addEventListener("input", function(){
dynamo()});
colorz.addEventListener("input", function(){
dynamo()});
css.addEventListener("load", function(){
dynamo()
});
/*function page(){
body.style.background= "linear-gradient(to right, red, yellow)";
css.textContent=body.style.background+";";
}
colorx.addEventListener("load", function(){
page()});
colorz.addEventListener("load", function(){
page()});*/