Selmy44 / Chat-Application

This is a Chat Application website

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Chat-Application

This is a Chat Application website

<title>Chat Application</title> <style> body { font-family: Arial, sans-serif; } #chat-box { width: 300px; height: 400px; border: 1px solid #ccc; overflow-y: scroll; padding: 10px; } #message-input { width: 250px; } #send-button { width: 50px; } </style>
Send
<script> const chatBox = document.getElementById('chat-box'); const messageInput = document.getElementById('message-input'); const sendButton = document.getElementById('send-button'); sendButton.addEventListener('click', () => { const message = messageInput.value; if (message.trim() !== '') { appendMessage('You', message); messageInput.value = ''; } }); function appendMessage(sender, message) { const messageElement = document.createElement('div'); messageElement.innerHTML = `${sender}: ${message}`; chatBox.appendChild(messageElement); chatBox.scrollTop = chatBox.scrollHeight; } </script>

About

This is a Chat Application website


Languages

Language:HTML 100.0%