Why does an object not yet in the DOM lack the on method in jQuery?
<p>I have this snippet of jQuery that errs:</p>

<pre><code>$("&lt;input&gt;").attr("type", "text")
    .attr("name", "wordFilter")
    .attr("placeholder", "Keywords...")
    .on("keyup", filterMyData)
    .appendTo(sidebar);
</code></pre>

<p><code>sidebar</code> is previously defined as <code>$("#sidebar")</code>. <code>filterMyData</code> is a function. Why is Chrome Web Developer issuing this error?</p>

<blockquote>
  <p>Uncaught TypeError: Object [object Object] has no method 'on' </p>
</blockquote>

<p>at the line <code>.on("keyup", filterMyData)</code>?</p>
