title: How to apply JQuery to PHP generated HTML?
body: <p>I have a PHP file that is generating HTML elements, and is being called from AJAX when the page loads. What I am looking to do is apply JQuery to the dynamically generated elements, so for each time a label, generated from the PHP file, is clicked something happens. I tried placing the JQuery code in the PHP file and echo it out, but that didnt work, I also placed the code in the HTML page, where the AJAX is being called, but that didnt work either.</p>
  
  <p>In my HTML I have:</p>
  
  <pre><code>&lt;body onLoad="javascript:getLabels();"&gt;, 
  </code></pre>
  
  <p>This calls the php file through AJAX:</p>
  
  <pre><code>function getComments() { 
      var thePage ='loadLabels.php'; 
      ... 
  </code></pre>
  
  <p>The PHP file as the line: </p>
  
  <pre><code>echo '&lt;label id="labellink" class="ldClass"&gt;Label &lt;/label&gt;'; 
  </code></pre>
  
  <p>which could be more then one label in the page once loaded, but all in their one <code>&lt;form&gt;</code>, so I need to use JQuery so once the labels are loaded and I click on them, I can make something happen. </p>