title: how onChange works for class using Jquery?
body: <p>I have experience using angular and jquery. In jquery i have often used selector like this:</p>
  
  <pre><code>     &lt;input name="name" class="cls"&gt;
       &lt;input name="age" class="cls"&gt;
  
       $('.cls').change(function(){ });
  </code></pre>
  
  <p>My Question is how is this implemented by jquery. How does it know when the value of an input changes. When jquery encounters this selector, will it go to all the classes containing this and add onchange event to make html like this?</p>
  
  <pre><code>     &lt;input name="name" class="cls" onchange="func_ref()"&gt;
       &lt;input name="age" class="cls" onchange="func_ref()"&gt;
  </code></pre>
  
  <p>Knowing this will help me better optimize frontend javascript. Lately i learned that Angular is truly magic but comes at the cost of performance.</p>