posts - 5,comments - 2,trackbacks - 0
例子:
 获得ifream的对象,并把ifreame中页面<div id="my">隐藏掉

test1.html

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

}
</script>
</head>
<body >
<input type="button" value="test" onClick="t();"/>
<iframe id="test2" name="test2" src="test2.html"></iframe>
</body>
</html>

test2.html
<html>
<head>
</head>
<body>
    
    
<div id="my" name="my">
       测试一下,父窗体可以把我隐藏掉!!!!!!!!
  
</div>
</body>
</html>



posted on 2008-03-09 13:48 Pitey 阅读(1566) 评论(1)  编辑  收藏

FeedBack:
# re: 获取 Iframe内的元素对象[未登录]
2008-03-10 13:04 | king
这种方法不行吧?  回复  更多评论
  

标题  
姓名  
主页
验证码 *  
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
该文被作者在 2008-03-09 14:06 编辑过
 
 

相关链接:
网站导航: