运行 ❯
获取您的
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
转到空间
<!DOCTYPE html> <html> <head> <style> #myDIV { width: 300px; height: 300px; margin-top: 20px; background-color: lightgreen; border-inline-width: 10px; border-inline-style: solid; border-inline-color: black; } </style> </head> <body> <h1>Change border-inline-color with JavaScript</h1> <p>Click the "Try it" button to change the border-inline-color property of the DIV element:</p> <button onclick="myFunction()">Try it</button> <div id="myDIV"> <h1>Hello</h1> </div> <script> function myFunction() { document.getElementById("myDIV").style.borderInlineColor = "pink"; } </script> </body> </html>