title: Set text limit using jquery
body: <p>There is some text comprised of 165 characters. I need to show only the first 155 characters, but the last 5 out of the 155 chars should be replaced with "....." (elipses), and the remaining characters should be removed. <a href="http://jsfiddle.net/kMEju/" rel="nofollow">fiddle</a></p>
  
  <pre><code>&lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;script type="text/javascript" src="jquery-1.8.3.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
      $(function(){
          var txt= $('div').text();
          for(i=0;i&lt;2;i++){
              alert(txt.charAt(150+ i))
          }
      })
  &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div style="width:100px"&gt;
  It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that
  &lt;/div&gt;
  &lt;/body&gt;
  </code></pre>