title: Using Jquery calling different functions with a singe link
body: <p><em>I would like to use single a href link to call different functions .<br/><br/>
  On first click it should call first_function() and on second click it should call second_function.<br/> Like toggling between two functions using same link. Suggest the best way to be done.</em></p>
  
  <blockquote>
    <p><strong><em>Jquery Code :</em></strong></p>
  </blockquote>
  
  <pre><code>$(function() {
  
   var IntervalId;
  
   function first_function() {
    //code goes here
   }; 
  
   function second_function(){  
    //code goes here
   }  
  
  $("#link2").click((function(){
  second_function();
  }));
  
  $("#link1").click((function(){
  first_function();
  }));
  
  });
  </code></pre>
  
  <blockquote>
    <p><strong><em>Html Code :</em></strong></p>
  </blockquote>
  
  <pre><code>&lt;a href="javascript:void(0);" id="link2"&gt;Call function2&lt;/a&gt;
  &lt;a href="javascript:void(0);" id="link1"&gt;Call function1&lt;/a&gt;
  </code></pre>