title: Javascript/Jquery : if rel is found then append data, otherwise, don't append data
body: <p><a href="http://jsfiddle.net/zD99p/" rel="nofollow">http://jsfiddle.net/zD99p/</a></p>
  
  <p>I've got the previous jsfiddle.  Right now, if you hover over "testing", you'll see a square block appear.  You'll notice in the html, the <code>&lt;a&gt;</code> for testing doesn't have a rel.  What do I add to prevent the appending on the text if there is no rel, but still append if a rel is found?</p>
  
  <p>Code:</p>
  
  <pre><code>this.screenshotPreview = function(){            
          xOffset = 20;
          yOffset = 30;
  
      $("tr").hover(function(e){
           var text = $(this).find('a').attr('rel');   
          $("body").append("&lt;p id='screenshot'&gt;"+ text +"&lt;/p&gt;");                                 
          $("#screenshot")
              .css("top",(e.pageY - yOffset) + "px")
              .css("left",(e.pageX + xOffset) + "px")
              .fadeIn("fast");                        
      },
      function(){
          this.title = this.t;    
          $("#screenshot").remove();
      });    
      $("a.screenshot").mousemove(function(e){
          $("#screenshot")
              .css("top",(e.pageY - yOffset) + "px")
              .css("left",(e.pageX + xOffset) + "px");
      });            
  };
  
  // starting the script on page load
  $(document).ready(function(){
      screenshotPreview();
  });
  </code></pre>
  
  <p>HTML: </p>
  
  <pre><code>&lt;table&gt;
      &lt;tr&gt;&lt;td&gt;content&lt;a rel="Testing this out.  This could be a long description. Blah blah blah. Testing this out.  Testing this out.  This could be a long description. Blah blah blah. Testing this out.  " &gt;&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;&lt;a&gt;Testing&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
      &lt;table&gt;
  </code></pre>