title: Dynamically change href in last tab of jquery 'next/previous tab' controls
body: <p>I use stackoverflow often so thanks to all who contribute - its been very helpful.</p>
  
  <p>I am not an avid programmer and use jquery at its most basic level. I hope someone can help.</p>
  
  <p>I would like to dynamically change the href url of '.nexttab' controls so that the user can move onto the next html page.</p>
  
  <p>The below is my (juvenile) code. </p>
  
  <pre><code>$(function() {
      $("#tabs").tabs();
      $(".nexttab").click(function() {
          var selected = $("#tabs").tabs("option", "selected");   
          $("#tabs").tabs("option", "selected", selected + 1);
  
          var href = $(this).attr('href');
          var lasttab = $(this).ui.panel('id');
          if(lasttab == 'tabs-7'){
           $('.nexttab').attr('href', href.replace('#','http://google.com.au'));
          }
  });
      $(".prevtab").click(function() {
          var selected = $("#tabs").tabs("option", "selected");   
          $("#tabs").tabs("option", "selected", selected - 1);
  });
  
  });
  </code></pre>
  
  <p>html is here</p>
  
  <pre><code>&lt;div id="control-arrows"&gt;
  &lt;a href="#" class="prevtab control-arrow-left"&gt;&lt; Back&lt;/a&gt; | &lt;a href="#" class="nexttab control-arrow-right"&gt;Continue &gt;&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>How can I identify the correct panel or tab (which is always the last) and then make the url change ?</p>
  
  <p>Thank you,
  Sarah</p>