编辑下面的代码:【加编码】
<html> <head> <style type="text/css"> #ex1 { border:1px solid red; outline:green dotted thick; } </style> <script> function displayResult() { document.getElementById("ex1").style.outline="thick solid #0000FF"; } </script> </head> <body> <div id="ex1">This is some text.</div> <br> <button type="button" onclick="displayResult()">Change outline</button> <p><b>Note:</b> IE8 supports the outline properties only if a !DOCTYPE is specified.</p> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂