Real-Time Chat
Work in progress
Explanation of the Code:
The HTML structure includes multiple chat rooms, each represented by a div with a unique id.
The CSS styles define the appearance and layout of the chat application.
The JavaScript code handles sending and displaying messages in the chat rooms.
The sendMessage(roomId) function is called when the "Send" button is clicked.
It retrieves the message from the input field corresponding to the given roomId.
It creates a formatted message with the username, message content, and timestamp.
It appends the formatted message to the chat messages list of the corresponding roomId.
It scrolls the chat messages list to the bottom to display the latest message.