现在有一个页面"aaa.html",一个页面"bbb.html",页面"bbb.html"中包含一个iframe,name="kkk",我想在页面"aaa.html"做个按钮或链接能打开"bbb.html"页面,并且改变iframe的src,该如何做,本人是菜鸟,望能提供完整的代码,谢谢。

解决方案 »

  1.   

    ##aa.html------------------------------------------------------------------------
    <script type="text/javascript">
    function aa(){
    newwin=window.open("bb.html");
    newwin.document.title="这是bb页面";
    newwin.document.getElementById("kkk").src="http://localhost"

    }
    </script><input type="button" onclick="aa()" value="试试效果">##bb.html------------------------------------------------------------------------
    <iframe src="http://baidu.com" name="kkk" id="kkk" frameborder="1"  border-color="green" scrolling="no" width="600" height="450" style="overflow:hidden">