title: How to calculate width of an line of text in Jquery?
body: <p>I am trying to figure out how to calculate just the width of one line of text with jquery.</p>
  
  <p>I have the following text in an string</p>
  
  <blockquote>
    <p>"Line 1</p>
    
    <p>Line 2</p>
    
    <p>Line 3</p>
    
    <p>Line 4 Blah</p>
    
    <p>Line 5"</p>
  </blockquote>
  
  <p>When testing to find the width of the text which is shown on the page it always shows 77 px from where line 4 is the longest.</p>
  
  <p>The text is put in using Jquery command .append() on the element id #text</p>
  
  <p>the code used for the element is</p>
  
  <pre><code>&lt;div id = 'terminal'&gt;&lt;pre&gt;&lt;span id = 'text'&gt;&lt;/span&gt;&lt;/pre&gt;
  </code></pre>
  
  <p>How would I calculate just the width of Line 5?</p>
  
  <p>Thanks - Ryan</p>