Mohemmad_B Mohemmad_B - 1 year ago 54
HTML Question

how to make jquery.tabs takes <li> name instead of <a> href

here is an example of what i need to achieve when i click on a

i want to change the tabs instead of clicking on
i need it for a reasons is there is a way to achieve that

$(function() {
$( "#tabs" ).tabs();


<div id="tabs">
<li name='tabs-1'>tab1</li>
<li name='tabs-2'>tab2</li>
<li name='tabs-3'>tab3</li>
<div id="tabs-1">...</div>
<div id="tabs-2">...</div>
<div id="tabs-3">...</div>

Answer Source

    $('#myTab li:last').tab('show')
.nav-tabs li {
   border-left:1px solid #000;
<script src=""></script>
<script src=""></script>
<link href="" rel="stylesheet"/>

<ul class="nav nav-tabs" id="myTab">
			  <li class="active" data-target="#home" data-toggle="tab">Home</li>
			  <li data-target="#profile" data-toggle="tab">Profile</li>
			  <li data-target="#messages" data-toggle="tab">Messages</li>
			  <li data-target="#settings" data-toggle="tab">Settings</li>

			<div class="tab-content">
			  <div class="tab-pane active" id="home">Home</div>
			  <div class="tab-pane" id="profile">Profile</div>
			  <div class="tab-pane" id="messages">Message</div>
			  <div class="tab-pane" id="settings">Settings</div>

Hope above solution meet your requirement

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download