为什么“footer text1”不在下面的代码中显示?
我的浏览器是Chrome 36.0.1985.125
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<div id="example">
<h2>Eric</h2>
<h2>Bidelman</h2>
<div>Digital Jedi</div>
<h4>footer text1</h4>
<h4>footer text2</h4>
</div>
<template id="sdom">
<header>
<content select="h2"></content>
</header>
<section>
<content select="div"></content>
</section>
<footer>
<content select="h4:first-of-type"></content>
</footer>
</template>
<script type="text/javascript">
var container = document.querySelector('#example');
var root = container.createShadowRoot();
var t = document.querySelector('#sdom');
var clone = document.importNode(t.content, true);
root.appendChild(clone);
</script>
</body>
</html>
答案 0 :(得分:0)