Tabs setting active

Tabs setting active

Hi,

I am trying to set the active tab, I intend to go on and use the local storage to record the tab a user last selected and display that tab when they return.

However I am falling at the first hurdle and cannot get the 2nd or 3rd tab to be active on page reload.

  1. <script>
       $(function() {
       $("#tabs").tabs();
       $( ".selector" ).tabs( "select", "tabs-2");
       });
    </script>
    <div id="tabs">
       <ul>
          <li>
             <a href="#tabs-1">
                Nunc tincidunt
             </a>
          </li>
          <li>
             <a href="#tabs-2">
                Proin dolor
             </a>
          </li>
          <li>
             <a href="#tabs-3">
                Aenean lacinia
             </a>
          </li>
       </ul>
       <div id="tabs-1">
          <p>
             Tab 1
          </p>
       </div>
       <div id="tabs-2">
          <p>
             Tab 2
          </p>
       </div>
       <div id="tabs-3">
          <p>
             Tab 3
          </p>
       </div>
    </div>









































What have I done wrong?
TC