如何使用JavaScript在一个声明中设置所有边框权利属性?
要在JavaScript中设置所有的borderright属性,请使用borderRight属性。使用此属性一次设置边框的颜色,样式和宽度。
示例
您可以尝试运行以下代码以了解如何一次设置所有边框权利属性-
<!DOCTYPE html>
<html>
<head>
<style>
#box {
border: thick solid gray;
width: 300px;
height: 200px
}
</style>
</head>
<body>
<div id="box">Demo Text</div>
<br><br>
<button type="button" onclick="display()">Change right border</button>
<script>
function display() {
document.getElementById("box").style.borderRight = "thick solid #000000";
}
</script>
</body>
</html>热门推荐
10 送花祝福语简短十一朵
11 姐妹结婚红包简短祝福语
12 老师高考后祝福语 简短
13 撩妹生日祝福语简短
14 同事调动的祝福语简短
15 对别人新年祝福语简短
16 弟弟的祝福语简短霸气
17 新年祝福语长辈简短红包
18 老婆生日祝福语简短孩子