title: jQuery. How do I select live created element?
body: <p>Here is the code:</p>
  
  <pre><code>    helpers.ajaxModuleFormRequest('blockcallback', $(this), function() {
          var timer = $('[data-timer]');
          var seconds = timer.data('timer');
  
          var interval = setInterval(function() {
              if (seconds == 0) {
                  clearInterval(interval);
              }
              timer.text(seconds);
              seconds--;
          }, 1000);
      });
  </code></pre>
  
  <p>helper.ajaxModuleFormRequest() does an AJAX-request and then in $.ajax.done() method calls callback-function specified in 3rd param.</p>
  
  <p><code>&lt;div data-timer="20"&gt;&lt;/div&gt;</code> is inserted in DOM live $.ajax.done() method and I want to select it to start the timer. But the code doesn't work, <code>$('[data-timer]').length</code> returns 0. How can I fix this?</p>