title: Browser back and forward button events, without a jQuery plugin
body: <p>I want to be able to add certain behavior when a user clicks browser "back" and "forward" buttons. </p>
  
  <p>Is there a way to say with JavaScript something like this: </p>
  
  <pre><code>backButton.onclick = function() {
  // do something
  }
  
  forwardButton.onclick = function() {
  //do something else
  }
  </code></pre>
  
  <p>Is there a way to do that directly with JavaScript, <strong>without relying on any plugin?</strong> </p>