title: Substring text with javascript including html tags
body: <p>i wanted to substring a string something like follow. And i have start position and length of the string . 
  i have checked this ques <a href="https://stackoverflow.com/questions/6003271/substring-text-with-html-tags-in-javascript">Substring text with HTML tags in Javascript</a>. But in this substring is performing from 0 but i have a random start position. Any idea about how it will done</p>
  
  <pre><code>var str = 'Lorem ipsum &lt;p&gt;dolor &lt;strong&gt;sit&lt;/strong&gt; amet&lt;/p&gt;, consectetur adipiscing elit.'
  </code></pre>