Hacker News new | ask | show | jobs
by beeboobaa 1073 days ago
Easy fix: In your script.js in the appendMessage function do this:

    const chatMessage = document.createElement("div");
    chatMessage.classList.add("chat-message");
    chatMessage.innerHTML = `<span class="username" style="color: ${color};">${username}:</span> `;
    const userMessage = document.createElement('span');
    span.innerText = message;
    chatMessage.appendChild(userMessage);
    chatContainer.appendChild(chatMessage);
    chatContainer.scrollTop = chatContainer.scrollHeight;
1 comments

I love how people here actually check the source code of a website. So HN