title: jQuery: $(element).text() doesn't work
body: <p>I am dynamically generating content - div's with links in them. Link should bring up a popup containing link's text when clicked (showMyText function). Instead I get an empty string :(</p>
  
  <p>Why isn't this working? I've searched Stackoverflow and jQuery API and it should work. </p>
  
  <pre><code>function a(){
      var div=document.createElement("div");
      div.innerHTML='&lt;a class="aClass" href="javascript:showMyText(this)"&gt;Link Text&lt;/a&gt;';
  
      var parent_div=document.getElementById('dinamicni_div');
      parent_div.appendChild(div);    
  }
  
  function showMyText(link){
      var txt=$(link).text();
      alert(txt);
  }
  </code></pre>