title: Tie a button to a javascript function
body: <p>I have a button in html:</p>
  
  <pre><code>&lt;button id="MyButton" onclick="return DoSomething()"&gt;Click Me&lt;/button&gt;
  </code></pre>
  
  <p>Is it better to put the "onclick" property in the html or use javascript/DOM to attach a callback to the button click?</p>