定義和用法:javascript
border 屬性在一個聲明中設置全部邊框屬性。css
語法:html
Object.style.border=borderWidth borderStyle borderColorjava
實例:ide
本例改變元素的邊框:spa
- <html>
- <head>
- <style type="text/css">
- p {
- border:thin double red;
- }
- </style>
- <script type="text/javascript">
- function changeBorder(){
- document.getElementById("p1").style.border="thick dotted green";
- }
- </script>
- </head>
- <body>
- <input type="button" onclick="changeBorder()" value="Change border" />
- <p id="p1">This is a paragraph</p>
- </body>
- </html>