js读取iframe里的元素

父层

<div id="SubStepNav" class="SubStepNav">
<iframe src="aaa.html" id="SubStepIframe" name="SubStepIframe"></iframe>
</div>

<script type="text/javascript">
$(frames["SubStepIframe"]).load(function () {
var $SubStep_Position = $(frames["SubStepIframe"].document).find(".SubStep_Position");
$SubStep_Position.addClass("SubStep_Position2");
});
</script>

iframe层aaa.html

<div class="SubStep_Position">……</div>

上一篇:UVa Dropping Balls


下一篇:关于Angular中时间戳的计算