【发布时间】:2015-07-30 10:02:02
【问题描述】:
以下代码适用于 chrome,但不适用于 Internet Explorer。有没有办法在 Internet Explorer 中使用它?
<html>
<head></head>
<body>
<div>
<h4>My Content Heading</h4>
<p>My content text</p>
</div>
<script>
var myContent = document.querySelector('div');
var shadowroot = myContent.createShadowRoot();
shadowroot.innerHTML =
'<h2>Inserted Heading</h2> <content select="p"></content>';
</script>
</body>
</html>
【问题讨论】:
-
IE11 不支持
标签: javascript internet-explorer-11 shadow-dom