Javascript: Loop Through Dynamically Generated Titles and Trunicate : <p>I have these titles that are dynamically generated on the server side of the app, and I would like to truncate them accordingly.</p>

<p>The snippet for generating the titles is:</p>

<pre><code> &lt;p class="prod-title"&gt;{{ product.title }}&lt;/p&gt;
</code></pre>

<p>The above generated an HTML code as:</p>

<pre><code>&lt;p class="prod-title"&gt; Title 1 &lt;/p&gt;
&lt;p class="prod-title"&gt; Title 2 &lt;/p&gt;
&lt;p class="prod-title"&gt; Title 3 &lt;/p&gt;
</code></pre>

<p>How can I truncate the generated titles based on a class using Jquery?</p>
