title: Jquery text limit without removing active tags
body: <p>I'm currently trying to limit the length of some dynamic titles on a project by using the following Jquery..</p>
  
  <p><strong>EDIT improvement via @Utkanos</strong></p>
  
  <pre><code>$(document).ready(function() {
  
  $(function(){
    $(".newsTitle").each(function(i){
      var len=$(this).text().length;
      if(len&gt;40) // If more than 35 characters then..
      {
        $(this).text($(this).text().substr(0,40)+'...'); // then add ...
        }
      });       
    });
  });
  </code></pre>
  
  <p>I need to be able to limit the title length however not damage the link tags wrapped around the title. Is this possible? This is the HTML I am having to work with.</p>
  
  <pre><code>&lt;h2 class="newsTitle"&gt;
      &lt;a href="/blog/new-story"&gt;Lorem Ipsum ameh dolor sit loremip ipsum&lt;/a&gt;
  &lt;/h2&gt;
  </code></pre>