title: jquery href and onclick separation
body: <p>I have code like this</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;a id="id101" href="javascript:func1();" onclick="return func2();"&gt;Link&lt;/a&gt;
  </code></pre>
  
  <p>func2 returns true or false. Then, func1 is called only when function2 returns true. Right ?</p>
  
  <p>In learning jquery, I found out that onclick is not good and depreciated, so I modified above code to </p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;a id="id101" href="javascript:func1();"&gt;Link&lt;/a&gt;
  </code></pre>
  
  <pre class="lang-js prettyprint-override"><code>jquery
  $("#id101").click(func2() {
    //same stuffs from before which was in func2
  });
  </code></pre>
  
  <p>Now, my question is:</p>
  
  <p>after click handler is taken care of, what can I do with JavaScript inside href? Should I call func1 inside func2 in jQuery click handler of func2, when condition inside func2 is true? 
  Or is there some elegant solution?</p>
  
  <p>Also, Separating html and events code is good, but here this element with id <code>id101</code>can have many events associated with it, and in a large file, there might be so many html elements with many events. So, when I have a large page with many event handlers, then how can I better know which html element has which and how many events associated with it?</p>
  
  <p>More explanation to above question as requested,</p>
  
  <p>I meant id101 can have onclick, onmouseover, onmouseout and many other such events. There can be many such elements with many such event handlers. How do I better spot them ? In old style, all such event handlers are all placed together, like this </p>
  
  <p><code>&lt;a id="id101" href="javascript:func1();" onclick="return func2();"&gt;Link&lt;/a&gt;</code>.</p>
  
  <p>I am not saying this is good, but atleast I can see that it has this onclick event. But now when separting this into jquery file, I have to search first this jquery file for id101 and then check events associated with it, which can be problem with html file having many elements and associated event handlers. Is there any better way to to find that information ?</p>