编辑下面的代码:【加编码】
<html> <head> <style type="text/css"> #ex1 { border: thin dotted #FF0000; } </style> <script> function displayResult() { document.getElementById("ex1").style.border="thick solid #0000FF"; } </script> </head> <body> <div id="ex1">This is some text.</div> <br> <button type="button" onclick="displayResult()">Change border</button> </body> </html>
结果: 【此窗口】 帮助?
Try it Yourself - © 自强学堂