title: Javascript callbacks vs dom events?
body: <p>Maybe it's a dumb question but I'd like to know the difference.
  When I want to invoke action when clicking on a button I have two options:</p>
  
  <p>first one is callback:</p>
  
  <pre><code>$("button").click(function(){
      $("p").hide("slow", function(){
          alert("The paragraph is now hidden");
      });
  });
  </code></pre>
  
  <p>The second one is using HTML <code>onclick</code>event attribute:</p>
  
  <pre><code>&lt;button onclick="myFunction()"&gt;Click me&lt;/button&gt;
  </code></pre>
  
  <p>The second one looks like more reliable. When you're looking at the code you can understand much more easy what is going on here, etc, etc... </p>
  
  <p>But I'm wondering is there any drawback in such approach? Can I replace all callbacks with second approach? </p>