How to return HTML from class in a variable
<p>I am using the code from Yoshi's answer for a jQuery Typewriter effect: </p>

<blockquote>
  <p><a href="http://stackoverflow.com/questions/13325008/typewriter-effect-with-jquery">Typewriter Effect with jQuery</a></p>
</blockquote>

<p>He's got text entered directly into the text area like so:</p>

<pre><code>jQuery('#target').teletype({
    text : [ 'some text' ]      
});
</code></pre>

<p>but I'm trying to pass the html from a class into the teletype function (to maintain the span elements).</p>

<pre><code>example html: &lt;h1 class="entry-title"&gt;&lt;span&gt;the&lt;/span&gt; Title&lt;/h1&gt;
</code></pre>

<p>I can print the text fine using <code>var str = jQuery(".entry-title").text();</code>
but that strips out the  elements. </p>

<p>I've tried a variation using html() instead of text() but it's returning "undefined"</p>

<pre><code>var htmlStr = jQuery(".entry-title").html();    
jQuery('#target').teletype({
    text : [ htmlStr ]      
});
</code></pre>

<p>Is there something I'm missing to return the html?</p>

<p>edit: the undefined error was that I had also tagged with target element with .entry-title for styling purposes.</p>
