title: How to declare events efficiently on div
body: <p>Which is the fastest way to declare multiple event listeners in JavaScript. Should I do it like this:</p>
  
  <pre><code> &lt;div onclick="myFunction();"&gt;
     &lt;div&gt;Element 1&lt;/div&gt;
     &lt;div&gt;Element 2&lt;/div&gt; 
   &lt;/div&gt;
  </code></pre>
  
  <p>Or like this:</p>
  
  <pre><code> &lt;div&gt;
     &lt;div onclick="myFunction();"&gt;Element 1&lt;/div&gt;
     &lt;div onclick="myFunction();"&gt;Element 2&lt;/div&gt; 
   &lt;/div&gt;
  </code></pre>
  
  <p>Does anybody have any advice?</p>