Why .live() works, but not .on()?
<p>In jquery1.71, .live() is deprecated. Nevertheless, it still works</p>

<pre><code>var toggleBtn = document.createElement('input');
toggleBtn.id = 'toggleBtn';
toggleBtn.type = 'button';
toggleBtn.value = 'Close';
box.appendChild(toggleBtn);

$('#toggleBtn').live('click', function() {
   alert("hihi");            
});
</code></pre>

<p>I tried the recommended .on(). Strangely, this fails</p>

<pre><code>var toggleBtn = document.createElement('input');
toggleBtn.id = 'toggleBtn';
toggleBtn.type = 'button';
toggleBtn.value = 'Close';
box.appendChild(toggleBtn);

$('#toggleBtn').on('click', function() {
   alert("hihi");            
}); 
</code></pre>
