-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstylevalue.js
More file actions
36 lines (26 loc) · 1.07 KB
/
Copy pathstylevalue.js
File metadata and controls
36 lines (26 loc) · 1.07 KB
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
window.addEventListener("load",function(){
var section = document.querySelector("#container");
var styleInput = section.querySelector(".style-input");
var widthInput = section.querySelector(".width-input");
var radiusInput = section.querySelector(".radius-input");
var colorInput = section.querySelector(".color-input");
var borderColorInput = section.querySelector(".bordercolor-input");
var widthValue = section.querySelector(".width-value");
var item = section.querySelector(".item");
styleInput.oninput = function(){
item.style.borderStyle = styleInput.value;
}
widthInput.oninput = function(){
item.style.borderWidth = widthInput.value+"px";
widthValue.innerHTML = widthInput.value;
}
radiusInput.oninput = function(){
item.style.borderRadius = radiusInput.value+"px";
}
colorInput.oninput = function(){
item.style.backgroundColor = colorInput.value;
}
borderColorInput.oninput = function(){
item.style.borderColor = borderColorInput.value;
}
});