title: Undo last executed function with jquery
body: <p>is there an opportunity to undo the execution of the last called function. For example I click a </p>
  
  <pre><code>&lt;nav&gt;&lt;a href="foo"&gt;...&lt;/a&gt;&lt;/nav&gt;
  </code></pre>
  
  <p>It has an onclick-listener, something like that:</p>
  
  <pre><code>$(function() {
      $('nav a').on('click', function() {
          $('nav a').removeClass('active');
          $(this).addClass('active');
          $($(this).attr('href')).addClass('active');
          return false;
      });
  });
  </code></pre>
  
  <p>I am looking for something with that I can undo the execution of the last function. Any suggestion? Thx!!! :)</p>