title: $(document).on("click"... not working?
body: <p>Is there a well-known mistake I could be making here?  </p>
  
  <p>I've got a script that's using .on() because an element is dynamically generated, and it isn't working.  Just to test it out, I replaced the selector with the dynamic element's wrap, which is static, and it still didn't work!  When I switched to plain old .click for the wrap it worked, though.<br>
  (This just won't work for the dynamic element obviously, the one that matters.)</p>
  
  <p><strong>This works:</strong></p>
  
  <pre><code>$("#test-element").click(function() {
      alert("click");
  });
  </code></pre>
  
  <p><strong>This doesn't:</strong></p>
  
  <pre><code>$(document).on("click","#test-element",function() {
      alert("click");
  });
  </code></pre>
  
  <p><strong><em>UPDATE:</em></strong></p>
  
  <p>I right-clicked and did "Inspect Element" in Chrome to just double-check something, and then after that the click event worked.  I refreshed and it didn't work, inspected element, and then it worked.  What does this mean?</p>