<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>

<body>
<script>
    function run(nums)
    {
        var e=document.getElementById("frame1");
        switch(nums)
        {
            case 1:e.src='https://www.baidu.com/';break;
            case 2:e.src='http://cn.bing.com/';break;
            case 3:e.src='http://www.google.cn/';break;
        }
    }
</script>
<div id="mm" style="background-color:#CCC">
    <span><button onClick="run(1)">百度</button></span>
    <span><button onClick="run(2)">bing</button></span>
    <span><button onClick="run(3)">google</button></span>
</div>
<center>
<div id="bd">
     <iframe id="frame1" style="width:25cm; height:20cm" frameborder="0" src="about:blank"></iframe>
</div>
</center>
</body>
</html>
0
Posted in Java Web

Leave a Comment:

电子邮件地址不会被公开。