I have been developing a chat application and one of the challenges I faced was dynamically populating messages in a div element
$('#conversation').append('<div class="message"><span><b>'+username+': </b>' + data + '</span></div>');
However, when a message is too long, it does not wrap to the next line as expected. I attempted to use
white-space:normal;
but unfortunately, it did not work. You can find a dummy example on this Fiddle