title: How to handle events on dynamically added elements in jQuery
body: <p>A fairly straightforward question - Why doesn't mouseover trigger for (text) inputs which are dynamically generated after the page has loaded?</p>
  <p>I can get it to work for checkbox, select, textarea...</p>
  <p>Below code doesn't give an event</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function () {
    $(`input[type=text]`).on(`mouseover`, function (e) {
      console.log(e);
    });
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;input type="text"&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>Below code gives an event for everything but text input:</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function () {
    $(`input, textarea, [type=checkbox], select`).on(`mouseover`, function (e) {
      console.log(e);
    });
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;input&gt;
  &lt;textarea&gt;&lt;/textarea&gt;
  &lt;input type="checkbox"&gt;
  &lt;select&gt;
    &lt;option&gt;test&lt;/option&gt;
  &lt;/select&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>How can I trigger mouseover event for a text input?</p>
  <p>EDIT: The text inputs are dynamically generated after the document has loaded.</p>
  <p>Thank you</p>