代码:
<body> <script type="text/javascript"> // 加载一个页面 function loadPage(){ document.onclick=function(){
//设置鼠标单击并将value传递到user_center_showpage里 var obj = event.srcElement; if(obj.href="a1"){ document.getElementById("user_center_showpage").src = obj.value; } } } </script> <div id="big_list"> #little_list为样式设置 <button id="little_list" href="a1" value="https://www.baidu.com/" onclick="loadPage()">百度</button> <button id="little_list" href="a1" value="https://www.cnblogs.com/" onclick="loadPage()">博客园</button> <button id="little_list" href="a1" value="http://www.4399.com/" onclick="loadPage()">4399</button> </div> #显示页面 <iframe id="user_center_showpage"> </iframe>
</body>