<div class="codetitle"> <span><a style="CURSOR: pointer" data="877" class="copybut" id="copybut877" onclick="doCopy('code877')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code877"> <br>//有两个按钮分别响应两个事件,用来控制iframe显示的网页。 <br><script type="text/javascript"> <BR>function bd(){ <BR>var baidu = document.getElementById("i"); <BR>baidu.src = "http://www.baidu.com"; <BR>} <BR>function xl(){ <BR>var sina = document.getElementById("i"); <BR>sina.src = "http://www.sina.com.cn"; <BR>} <BR></script> <br><style type="text/css"> <BR>#i{ <BR>width:400px; <BR>height:300px; <BR>} <BR></style> <br> <br><br> <br><iframe id="i" scrolling="no"> <br></iframe> <br><div> <br><input type="button" value="百度" onclick="bd()"> <br><input type="button" value="新浪" onclick="xl()"> <br> </div> <br> <br> </div>