title: Anchor tag jQuery Click
body: <p>I have an Anchor Tag like this</p>
  
  <pre><code>    &lt;a href="javascript:anchorScr()" id="anch1" class ="af-link"/&gt;
  </code></pre>
  
  <p>It is taking me two clicks on the anchor tag  to respond to the javascript function anchorScr();</p>
  
  <pre><code>function anchorScr() {
  jQuery('a').click(function (event) {
      var id = $(this).attr("id");
      alert(id);
     });
   }
  </code></pre>
  
  <p>Am I doing something wrong? Why my anchorScr() is not called on the first click ?</p>