How to set as second tab as selected

demonic

New Member
I have got a task to do jquery tab. Each tab has some special function.When loading the page it goes to the first tab.I want to set the second tab as selected> How can I do that?My code is\[code\]<!DOCTYPE html><html><head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Jquery-Tab</title> <script type='text/javascript' src='http://code.jquery.com/jquery-1.9.1.js'></script> <script type="text/javascript" src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script> <link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css"> <link rel="stylesheet" type="text/css" href="http://stackoverflow.com/css/result-light.css"> <style type='text/css'> .ui-state-disabled { display: none;} </style><script type='text/javascript'>//<![CDATA[ $(window).load(function(){ $(function() { $("#tabs").tabs(); $("#tabs").tabs("option", { "selected": 2, "disabled": [1,2,3] });$( "input[type=checkbox]" ).click(function(){ if ($(this).is(':checked')) { $('#tabs').tabs("enable", $(this).val()); $('#tabs').tabs("select", $(this).val() ); } else{ $('#tabs').tabs("disable", $(this).val()); }});});});//]]> </script></head><body> <div id="tabs"> <ul> <li><a href="http://stackoverflow.com/questions/15539538/#tabs-1">Nithin</a> </li> <li><a href="http://stackoverflow.com/questions/15539538/#tabs-2">Vipin</a></li> <li><a href="http://stackoverflow.com/questions/15539538/#tabs-3">Sachin</a></li> <li><a href="http://stackoverflow.com/questions/15539538/#tabs-4">Ganguly</a></li> </ul> <div id="tabs-1"> <p>Nithin</p> </div> <div id="tabs-2"> <p>Vipin</p> </div> <div id="tabs-3"> <p>Sachin</p> </div> <div id="tabs-4"> <p>Ganguly</p> </div></div><input type="checkbox" name="tabs-1" value="http://stackoverflow.com/questions/15539538/1">tabs-1 <input type="checkbox" name="tabs-2" value="http://stackoverflow.com/questions/15539538/2">tabs-2 <input type="checkbox" name="tabs-3" value="http://stackoverflow.com/questions/15539538/3">tabs-3 <input type="checkbox" name="tabs-4" value="http://stackoverflow.com/questions/15539538/4">tabs-4 <br></body></html>\[/code\]You can see from http://jsfiddle.net/2aQ2g/35/
 
Back
Top