forked from wesbos/JavaScript30
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
18 lines (17 loc) · 767 Bytes
/
index.js
File metadata and controls
18 lines (17 loc) · 767 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
var myImg = document.getElementById('myImg');
var selectedColor = document.getElementById('selectedColor').value;
var borderWidth = document.getElementById('borderWidth').value;
var imgBlur = `${document.getElementById('imgBlur').value}px`;
myImg.style.border = `${borderWidth}px solid ${selectedColor}`;
function changeBorderColor() {
selectedColor = document.getElementById('selectedColor').value;
myImg.style.border = `${borderWidth}px solid ${selectedColor}`;
}
function changeBorderSpacing() {
borderWidth = document.getElementById('borderWidth').value;
myImg.style.border = `${borderWidth}px solid ${selectedColor}`;
}
function changeImgBlur() {
imgBlur = `${document.getElementById('imgBlur').value}px`;
myImg.style.filter = `blur(${imgBlur})`;
}