Update chatroom.HTML

This commit is contained in:
Dangrainage 2023-08-28 20:05:39 +02:00 committed by GitHub
parent bac63ef817
commit 1402a1a9bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -29,16 +29,13 @@
<input type="text" id="message" placeholder="Type your message"> <input type="text" id="message" placeholder="Type your message">
<button id="send">Send</button> <button id="send">Send</button>
<!-- Include the Socket.io script from a CDN --> <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.0.1/socket.io.js"></script>
<script src="https://cdn.socket.io/4.0.1/socket.io.js"></script>
<script> <script>
const chatbox = document.getElementById('chatbox'); const chatbox = document.getElementById('chatbox');
const messageInput = document.getElementById('message'); const messageInput = document.getElementById('message');
const sendButton = document.getElementById('send'); const sendButton = document.getElementById('send');
// Connect to the Socket.io server const socket = io(); // Connect to the Socket.io server
const socket = io();
sendButton.addEventListener('click', function() { sendButton.addEventListener('click', function() {
const message = messageInput.value; const message = messageInput.value;