title: onclick="" vs event handler
body: <p>If I want a function to be executed, I prefer doing inline js:</p>
  
  <pre><code>&lt;p id="element" onclick="doSomething();"&gt;Click me&lt;/p&gt;
  </code></pre>
  
  <p>because it is easier to debug.</p>
  
  <p>However, I hear people saying not to use inline js, and do:</p>
  
  <pre><code>document.getElementById('element').onclick = doSomething;
  </code></pre>
  
  <p>Why is the js event listener recommended?</p>