
如图改变border颜色,宽度,我写的怎么改
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
#box {
width: 200px;
height: 200px;
background-color: bisque;
border: solid black;
}
</style>
</head>
<body>
<span>宽</span> <input type="range" id="width" min="1" max="15"><br>
<span>R</span><input type="range" id="red" min="0" max="255"><br>
<span>G</span><input type="range" id="green" min="0" max="255"><br>
<span>B</span> <input type="range" id="blue" min="0" max="255">
<div id="box"></div>
<script>
const wide = document.querySelector('#width')
const r = document.querySelector('#red')
const g = document.querySelector('#green')
const b = document.querySelector('#blue')
const box = document.querySelector('#box')
box.style.borderColor = `rgb(${r},${g},${b})`
box.style.borderWidth = `${wide}px`
</script>
</body>
</html>