title: Creating a same-page event with JQuery
body: <p>I am trying to make jquery trigger an event when an anchor link has the same URL as the current page. Eventually this will add a class to the anchor link and let me style it differently with CSS but for now I just want it to show an alert box. Code below doesn't seem to work:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(document).ready(function() {
  
  var buildurl = window.location.href;
  
  if($('a').attr('href') = buildurl){
  
      alert("Done");
  
  }
  
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>Can anybody shine a light on why this isn't working? Or a best practice for similar using JQuery?</p>
  
  <p>Link is: <a href="http://www.otahboy.com/shop/index.php?route=information/information&amp;information_id=4" rel="nofollow">http://www.otahboy.com/shop/index.php?route=information/information&amp;information_id=4</a></p>
  
  <p>Cheers,</p>
  
  <p>Jack</p>