JavaScript 参考手册
Style borderRight 属性
更改右边框的宽度、样式和颜色
源代码:
点击运行 »
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>蜜蜂教程(mifengjc.com)</title> <style type="text/css"> #ex1 { border: thin dotted #FF0000; } </style> <script> function displayResult() { document.getElementById("ex1").style.borderRight = "thick solid #0000FF"; } </script> </head> <body> <div id="ex1">这是一些文本。</div> <br> <button type="button" onclick="displayResult()">修改右边框</button> </body> </html>
运行结果:
点击运行 »