Reputation: 183
I am following this link link to dynamically add read more to text if it exceeds x no of characters. Working fine with below case.
<div class="comment more">weekly, monthly or quarterly analysi...</div>
not with this case
<div class="comment more"><p>weekly, monthly or quarterly analysi...</p></div>
by adding a p tag it stops working
Upvotes: 0
Views: 37
Reputation: 12452
You have to select the p
element in line 7
+16
then, to get and set the correct content:
var content = $("p", this).html();
// ...
$("p", this).html(html);
Upvotes: 1