title: jQuery hide dynamically generated element by clicking on static element
body: <p>I've been looking for an answer to this, but I haven't quite been able to find something on stackoverflow that specifically addresses this issue.</p>
  
  <p>Essentially, I have some radio elements that are dynamically generated by jQuery (although after the page has loaded—they get loaded when text is entered into an input field), and I need to check these dynamically loaded radio elements on a <code>keyup</code> event.</p>
  
  <p>If I were clicking on the dynamically loaded elements, I could just use the <code>live</code> function. However, I need to check these elements when a certain <code>keyup</code> event occurs while I'm focused inside a standard DOM element input field (i.e. not generated by jQuery).</p>
  
  <p>Note that the keys array is just an associative array of keys with numerical keyCode values.</p>
  
  <p>So, the following does not work:</p>
  
  <pre><code>$('#inputField').bind('keyup', function(k) {
    switch (k.keyCode) {
      case keys['up']:
        $('#dynamicallyGeneratedElement').attr('checked', true);
        break;
    }
  });
  </code></pre>
  
  <p>Because the dynamically generated radio elements weren't there at DOM ready. Is there a way to solve this?</p>