【发布时间】:2016-05-24 16:25:23
【问题描述】:
<html dir="LTR">
<head></head>
<body>
<iframe id="id_description_iframe" class="rte-zone" height="200" frameborder="0" title="description">
<html>
<head>
<script>
alert('document.querySelector("html").dir');
</script>
</head>
<body class="frameBody">
test<br/>
</body>
</html>
</iframe>
</body>
</html>
我需要的是 html 中 dir 的值,即“LTR”。
我在 iframe 的代码中尝试了 "document.querySelector("html").dir",它在查找第二个 html 标记时返回 ""。
【问题讨论】:
标签: javascript html iframe directory