打开JSP 首先执行或刷新时执行方法的代码
$(function(){ xuan1(); })
需要引用的文件
< script type="text/javascript" src="/resources/js/jquery-1.7.2.min.js">

function xuan1(){ document.getElementById("qv1").style.display = "block"; document.getElementById("qv2").style.display = "none"; }
function xuan2(){ document.getElementById("qv1").style.display = "none"; document.getElementById("qv2").style.display = "block"; }
.qv1{ width:1300px; height:200px; border:1px solid red; background:silver; float:left; }
.qv2{ width:1300px; height:200px; border:1px solid red; position:relative; background:silver; float:left; }
< div class="button1">
< input type="button" value="qv1" id="" class="buttona" onclick="xuan1()" style="margin-top:0px;width:150px;height:25px;font-size:14px;"/>
< /div>

选项卡效果