您的 宣传网址:
复制网址
手机查看
宣传有奖
首页
编程学习
源代码:
html编辑器
颜色值转换
点击运行
空若网 <h1>template 元素</h1> <p>点击按钮显示 template 元素中的隐藏内容。</p> <button onclick="showContent()">显示隐藏内容</button> <template> <h2>logo</h2> <img src="https://static.jyshare.com/libs/images/runoob-logo.png" > </template> <script> function showContent() { var temp = document.getElementsByTagName("template")[0]; var clon = temp.content.cloneNode(true); document.body.appendChild(clon); } </script>
运行结果:
×
空若网-温馨提示
您尚未登陆
请登陆后在来吧
立即登陆
注册账号
空若网