 // Add a click event listener to the 'send' button
sendbtn.addEventListener("click", async () => {
  const inputText = inputbox.value;
   chatbox.innerHTML += `<p><strong>User:</strong> ${inputText}</p>`;
  chatbox.scrollTop = chatbox.scrollHeight;
   if (inputText.trim() !== "") {     
    // Send message to the server
    const message = JSON.stringify({ text: inputText });
    ws.send(message);
     // Send message to the chatbot
    askQuestion(inputText, message);
  }
});

  // Periodically fetch and 