title: Prevent a link to reload page
body: <p>I am creating a responsive menu: <a href="http://codepen.io/mdmoura/pen/alxkI" rel="noreferrer">Codepen Demo</a></p>
  
  <p>To avoid the page to be reloaded when I click a link I have:</p>
  
  <pre><code>$('nav.menu a[href="#"]').click(function () {
    $(this).preventDefault();
  });
  </code></pre>
  
  <p>But this does not seem to work. When I click a button the menu disappears.</p>
  
  <p>Does anyone knows what I am be doing wrong?</p>