title: Do function on newly created element with jquery
body: <p>When I dynamically add a new element, I want to apply some function to it. For example, to turn regular <code>&lt;input&gt;</code> into date-time selector (via some plugin) I need to</p>
  
  <pre><code>$('.dt').dateTime();
  </code></pre>
  
  <p>The function above only works the first time I add elements during initialization.
  Whenever I add them later using <code>.append()</code> the function is not applied. For <em>event listeners</em> I use <code>$(document).on()</code> instead:</p>
  
  <pre><code>$(document).on('click', '.dt', function () {});
  </code></pre>
  
  <p>and it works in any case.</p>
  
  <p>What is the equivalent to use on creation?</p>
  
  <p>On SO I've seen solutions to similar problems that either use function <code>.live()</code> which is now deprecated, or use some sort of plugin which I don't want.</p>
  
  <p>Is there any solution in plain jquery?</p>