首先下载bootstrap-tab.js和bootstrap.min.css
<script type="text/javascript">
$(‘#myTab a‘).click(function (e)
{
e.preventDefault();
$(this).tab(‘show‘);
});
</script>
<body>
<ul class="nav nav-tabs" style="float:left;">
<li><a href="javascript:test()"
data-toggle="tab">首页</a></li>
<li><a href="#profile"
data-toggle="tab">Profile</a></li>
<li><a href="#messages"
data-toggle="tab">Messages</a></li>
<li><a href="#settings"
data-toggle="tab">Settings</a></li>
</ul>
</body>