Remove Active link on click

Remove Active link on click

Hi Guys,
I know this is simple to do but i have no idea how to do it. I have the sript below. What i want to do is to remove the active link highlight wheni click the same link.

Thanks in advance

  1. <script type="text/javascript">
  2. $(function() {
  3.    var links = $('a.link').click(function() {
  4.        links.removeClass('active');
  5.        $(this).addClass('active');
  6.    $(this).on('click', 'a.active', function(e){
  7.         // Make the old tab inactive.
  8.         $active.removeClass('active');
  9.         $content.hide();
  10.        e.preventDefault();
  11.    });
  12.    }); 
  13.   
  14. });
  15. </script>