I have now a text wrapper, this works only on first div with same name, but my code creates automatically this div based on new messages.
How can I make it work with all other divs with the same name?
$(document).ready(function(){
var content=$(".reply_message").html();
var description=content.substr(0,100); //first 140 characters allowed to show
$(".reply_message").html(description+"...");
$("#show").on("click",function(){
var more=$("#show").html();
if(more=="Show more")
{
$("#show").html("Show less");
$(".reply_message").html(content);
}
else
{
$("#show").html("Show more");
$(".reply_message").html(description+"...");
}
});
});