运行 ❯
获取您
自有
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <body> <p>Click the button to create an ASIDE element containing a H4 and P element.</p> <button onclick="myFunction()">Try it</button> <script> function myFunction() { var x = document.createElement("ASIDE"); x.setAttribute("id", "myAside"); document.body.appendChild(x); var heading = document.createElement("H4"); var txt1 = document.createTextNode("Epcot Center"); heading.appendChild(txt1); document.getElementById("myAside").appendChild(heading); var para = document.createElement("P"); var txt2 = document.createTextNode("The Epcot Center is a theme park in Disney World."); para.appendChild(txt2); document.getElementById("myAside").appendChild(para); } </script> </body> </html>