title: select child at beginning of function jquery
body: <p>I can't appear to select the child form of a div I have for some reason.</p>
  
  <p>For the matter, I am trying to find a way that I can have a function select the child form of a div since I have it changing for a toggling function at my site.</p>
  
  <pre><code>$(document).ready(function(){
                      $("#soundToggle, #soundOffForm").submit(function(event){
                          /*var r = new XMLHttpRequest(); 
                          r.open("POST", "sessionsetter.php", true);
                          r.onreadystatechange = function () {
                              if (r.readyState != 4 || r.status != 200) return; 
                              console.log(r.responseText);
                          };
                          r.send("a=1&amp;b=2&amp;c=3");*/
                          alert("post");
                          event.preventDefault();
                          $.ajax({
                              type: "POST",
                              url: "sessionsetter.php",
                              data: {
                                  sound : '0',
                              },
                              success: function(data) {
                                  //alert("Sound toggled successfully: " + data);
                                  $('#soundToggle').load(location.href + " #soundOnForm");
  
                              },
                              error: function(data) {
                                  alert("Error in processing request: " + data);
                              }
                          });
                      });
  
                      $("#soundToggle, #soundOnForm").submit(function(event){
                          event.preventDefault();
  
                          $.ajax({
                              type: "POST",
                              url: "sessionsetter.php",
                              data: {
                                  sound : '1',
                              },
                              success: function(data) {
                                  //alert("Sound toggled successfully: " + data);
                                  $('#soundToggle').load(location.href + " #soundOffForm");
                              },
                              error: function(data) {
                                  alert("Error in processing request: " + data);
  
                              }
                          });
                      });
                  });
  </code></pre>
  
  <p>Anyone have any suggestions on how I can make this a possibility? Thanks. When I don't select the child of a form, the handler is destroyed as I replace the form in my DOM.</p>