執行 ❯
建立您
自己的
網站
×
更改方向
儲存程式碼
更改主題,深色/淺色
前往 Spaces
<!DOCTYPE html> <html> <body> <h1>Change text-shadow with JavaScript</h1> <p>Click the "Try it" button to add a red shadow to the H1 element:</p> <button onclick="myFunction()">Try it</button> <h1 id="myH1">This is my header</h1> <script> function myFunction() { document.getElementById("myH1").style.textShadow = "2px 5px 5px red"; } </script> </body> </html>