Click here to Skip to main content
15,893,368 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
JavaScript
<script type="text/javascript">
        $(document).ready(function () {
            $("#content div").hide(); 
            $("#tabs li:first").attr("id", "current"); 
            $("#content div:first").fadeIn(); 
 
            $('#tabs a').click(function (e) {
                e.preventDefault();
                $("#content div").hide();
                $("#tabs li").attr("id", ""); 
                $(this).parent().attr("id", "current"); 
                $('#' + $(this).attr('title')).fadeIn();
            });
        })();
Posted
Updated 10-Jun-14 22:10pm
v2

1 solution

Remove the closing () from your code!
JavaScript
$(document).ready(function () {
  $("#content div").hide();
  $("#tabs li:first").attr("id", "current");
  $("#content div:first").fadeIn();

  $('#tabs a').click(function (e) {
    e.preventDefault();
    $("#content div").hide();
    $("#tabs li").attr("id", "");
    $(this).parent().attr("id", "current");
    $('#' + $(this).attr('title')).fadeIn();
  });
})();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900