取ifrme里的div的代码

发表时间:2008-4-10 18:45:00

a.htm
---------------------------------------------------------
<html>
<head>
<script>
function GetFrmVal() {
 var frm = document.frames["frm"];
 alert(frm.document.all["divA"].innerHTML);
}
</script>
</head>
<body>
<input type="button" value="button" onclick="javascript:GetFrmVal();" type="button" />
<iframe id="frm" name="frm" src="http://www.blog.com.cn/b.htm" />


</body>
</html>


b.htm
------------------------------------------------------------------
<html>
<head>
</head>
<body>
<div id="divA" name="divA">DIVA</div>
</body>
</html>

你可能感兴趣的:(div)