运行 ❯
获取您
自己的
网站
×
更改方向
保存代码
更改主题,深色/浅色
前往 Spaces
<!DOCTYPE html> <html> <body> <h2>How to Create a thead Element</h2> <p>Click "Try it" to create a TIME element that specifies the date of "Valentines day (2014-02-14)".</p> <button onclick="myFunction()">Try it</button> <script> function myFunction() { var x = document.createElement("TIME"); x.setAttribute("datetime", "2014-02-14"); var t = document.createTextNode("Valentines day"); x.appendChild(t); document.body.appendChild(x); } </script> </body> </html>