simple use below are step by step code so use it easily:
Jquery Code:
<script> $(document).ready(function() { $('.xtab:eq(0)').show().siblings('.xtab').hide(); //$('.xtab').text('').hide(); $('.xTab').click(function() { var i=$('.xTab').index(this); $(this).siblings('.xTab').removeClass('active'); $(this).addClass('active'); $('.xtab:eq('+i+')').siblings('.xtab').hide(); $('.xtab:eq('+i+')').show(); }); }); </script>
css code:
<style> .tabs a:hover { -moz-border-radius: 5px 5px 5px 5px; font: 11px Arial,Helvetica,sans-serif; background:#000; padding: 7px; text-decoration: none; color:#fff; } .tabs a.active { -moz-border-radius: 5px 5px 5px 5px; font: 11px Arial,Helvetica,sans-serif; padding: 7px; text-decoration: none; background:#000; color:#fff; } .tabs a{ text-decoration:none; color:#000; font:11px Arial, Helvetica, sans-serif; padding: 7px;}
HTML CODE:
<div id="hold_container"> <span class="tabs"> <a class="xTab active" href="#">tab1</a> <a class="xTab" href="#">tab2</a> <a class="xTab" href="#">tab3</a></span> <div class="xtab" style="display: block;"> <h1> Tab one data</h1> <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p> </div> <div class=" xtab" style="display: none;"> <h1> Tab two data</h1> <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p> </div> <div class=" xtab" style="display: none;"> <h1> Tab three data</h1> <p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p> </div> </div>
Note: as it is jquery basse tab so do not forget to include the Jquery library(latest).