<!DOCTYPE html> <html> <body> <h1>template 元素</h1> <script> if (document.createElement("template").content) { document.write("您的浏览器支持 template!"); } else { document.write("您的浏览器不支持 template!"); } </script> </body> </html>