執行 ❯
建立您
自己的
網站
×
更改方向
儲存程式碼
更改主題,深色/淺色
前往Spaces
<!DOCTYPE html> <html> <body> <p>Click the button to create a SCRIPT element that alerts "Hello World!".</p> <button onclick="myFunction()">Try it</button> <script> function myFunction() { var x = document.createElement("SCRIPT"); var t = document.createTextNode("alert('Hello World!')"); x.appendChild(t); document.body.appendChild(x); } </script> </body> </html>