title: JQuery - get attr/text from HTML string in a variable
body: <p>I have a HTML string that I'm passing through a function and I want to be able to perform Jquery methods on that variable from inside the function - such as <code>.attr('href')</code> or <code>.text()</code>.  I'm sure there is a simple solution for this and something more elegant then temporarily appending the DOM.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;div class="here"&gt;&lt;/div&gt;
  </code></pre>
  
  <p><strong>Javascript</strong></p>
  
  <pre><code>link = '&lt;a href="http://www.google.com"&gt;Google&lt;/a&gt;';
  
  // This works
  $('.here').html(link);
  works = $('.here').text();
  console.log(works);
  
  // This doesn't
  not = link.text();
  console.log(not);
  </code></pre>
  
  <p><a href="http://jsfiddle.net/dfgYK/" rel="nofollow">http://jsfiddle.net/dfgYK/</a>  </p>