JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" id="text-box">
<button id="submit-button">Submit</button>

<div id="chat-output"></div>

JavaScript

function appendMessage(){
    var inputValue = document.getElementById("text-box").value;
    document.getElementById("chat-output").innerHTML += inputValue;
}

var button = document.getElementById("submit-button");

button.onclick = appendMessage;