文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>获取 Iframe内的元素对象

获取 Iframe内的元素对象

时间:2010-07-18  来源:fkshl

test1.html
<html>
<head>
<script>
function t(){
var dd = document.all('test2').contentWindow.document;
dd.getElementById('my').style.display='none';

}
function getImage(paht)
{
var dd = document.all('test2').contentWindow.document;
dd.getElementById('covertImage').src=paht;
}
</script>
</head>
<body >
<input type="button" value="test" onClick="t();"/>
<input type="button" value="image1" onClick="getImage('1.jpg')"/>
<input type="button" value="image2" onClick="getImage('2.jpg')"/>
<input type="button" value="image3" onClick="getImage('3.jpg')"/>
<input type="button" value="image4" onClick="getImage('4.jpg')"/>
<iframe id="test2" name="test2" src="test2.html" frameborder="0" ></iframe>
</body>
</html>
test2.html
<html>
<head>
</head>
<body>
   
    <div id="my" name="my">
       测试一下,父窗体可以把我隐藏掉!!!!!!!!
   </div>
   <img src="" id="covertImage"/>
</body>
</html>
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载