title: jQuery check for certain class won't work
body: <p>For my menu i want to check if an clicked element has e certain classname. If it has, a specific action should follow, otherwise not. Herefore i have the following approach that doesn;t work..</p>
  
  <pre><code>$(function(){
      $("a").click(function(event){
          if(this.hasClass("noLink")){
              event.preventDefault();
              alert("no link here");
          }
      });
  });
  ..
  &lt;a href="page.html" title="Title" class="topNav noLink" id="site">Link&lt;/a></code></pre>
  
  <p>The code above won't work, it will go to the page.html and i don't get my alert. What am i doing wrong here?</p>
  
  <p>I also tried <code>if(this.hasClass("noLink") == 'true'){</code> but that neither did the trick..</p>
  
  <p>Any help is appreciated!</p>