I have been using this particular code snippet to display messages.
setTimeout(function(){
o.html(o.html() + "Username:<br>" + msg[r] + "<br><hr>")
}, 7000);
It's effective in posting messages from an array and adding some styling.
However, the current output of a posted message looks like this:
Username:
messagehere
<hr>
What I aim for is to have the code display an image before the username and message, similar to what you would see on Facebook when engaging with someone through chat or comments.
I attempted to simply add +<img src="" class=""/>
in front of it, but that caused the code to stop functioning altogether.
Therefore, I am seeking guidance on the correct approach to achieve this. I would like to assign a class to it so that I can style the entire block with CSS (having the avatar preceding the message and username, as mentioned earlier).
If anyone could assist me in finding the proper solution, I would greatly appreciate it.