title: jQuery Not Appending to Dynamically Created Elements
body: <p>On my page, I have a dynamically generated list of radio buttons (created with AJAX). The list of radio buttons is dynamically generated because it changes based on a previous form selection. Here is an example of a dynamically generated list of radio buttons (this appears in Firefox's DOM viewer add-on, but not in "View Page Source"):</p>
  
  <pre><code>&lt;li&gt;
  &lt;input name="giftcard_value" type="radio" id="25" value="25" /&gt;
  &lt;label for="25"&gt;$25&lt;/label&gt;
  &lt;a class="radio-select" href="#"&gt;Select&lt;/a&gt;&lt;a class="radio-deselect" href="#"&gt;Cancel&lt;/a&gt;
  &lt;/li&gt;
  
  &lt;li&gt;
  &lt;input name="giftcard_value" type="radio" id="50" value="50" /&gt;
  &lt;label for="50"&gt;$50&lt;/label&gt;
  &lt;a class="radio-select" href="#"&gt;Select&lt;/a&gt;&lt;a class="radio-deselect" href="#"&gt;Cancel&lt;/a&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>I also have another jQuery script that I am using to "click" radio buttons indirectly via links/images. In the above code, the actual radio button (inside the input tag) is hidden from the user. The user clicks the radio button by clicking the Select link that has the class "radio-select" (this is actually an image). The jQuery script detects when the link/image is clicked with '$(".radio-select").click' and then runs a function which "clicks/checks" the actual radio button. Here is the jQuery script:</p>
  
  <pre><code>$(".radio-select").click(
              function(event) {
                  event.preventDefault();
                  var $boxes = $(this).parent().parent().children();
                  $boxes.removeClass("selected");
                  $(this).parent().addClass("selected");
                  $(this).parent().find("[type=radio]").click().attr("checked","checked");
              }
          );
  </code></pre>
  
  <p>My problem is that the jQuery script does NOT work with the dynamically generated radio buttons. It works if I hard code the radio buttons into the html (viewable via "view page source" in a browser), but not if they're generated dynamically. It seems like the jQuery is not able to detect the ".click" on the link/image, and thus never clicks the actual radio button. Any idea what the problem is? Any help would be much appreciated!</p>