title: dynamically add listener to ajax created content in jQuery
body: <p>I am trying to get the html value of a linked clicked.
  The links are created dynamically with Ajax so I don't think .bind will 
  work and I don't have latest version with  .live</p>
  
  <pre><code>$('div#message').click(function() {
    var valueSelected = $(this).html();  // picks up the whole id. I juust want single href!          
    alert(valueSelected);
    return false;
  });
  
  
  
  &lt;div id="message"&gt;
  &lt;br/&gt;
  &lt;a class="doYouMean" href="#"&gt;location A&lt;/a&gt;
  &lt;br/&gt;
  &lt;a class="doYouMean" href="#"&gt;location B&lt;/a&gt;
  &lt;br/&gt;
  &lt;a class="doYouMean" href="#"&gt;location C&lt;/a&gt;
  &lt;br/&gt;
  &lt;a class="doYouMean" href="#"&gt;location D&lt;/a&gt;
  &lt;br/&gt;
  &lt;a class="doYouMean" href="#"&gt;location E&lt;/a&gt;
  &lt;br/&gt;
  &lt;/div&gt;
  </code></pre>