-
Notifications
You must be signed in to change notification settings - Fork 1
/
SliderTest.html
56 lines (34 loc) · 1.08 KB
/
SliderTest.html
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<html>
<script>
var r = 255;
var g = 255;
var b = 255;
function sliderChange(){
document.body.style.backgroundColor = ("rgb("+r+","+g+","+b+")")
}
function sliderChangeR(val){
r = val;
document.getElementById("rValue").innerHTML = r;
sliderChange();
}
function sliderChangeG(val){
g = val;
document.getElementById("gValue").innerHTML = g;
sliderChange();
}
function sliderChangeB(val){
b = val;
document.getElementById("bValue").innerHTML = b;
sliderChange();
}
</script>
<body>
<a href = "index.html">Home</a> <br>
<input type="range" id="Slider" min="0" max="255" onchange="sliderChangeR(this.value)"/> <br>
<input type="range" id="Slider" min="0" max="255" onchange="sliderChangeG(this.value)"/> <br>
<input type="range" id="Slider" min="0" max="255" onchange="sliderChangeB(this.value)"/> <br>
<p id = "rValue">255</p>
<p id = "gValue">255</p>
<p id = "bValue">255</p>
</body>
</html>