JSFiddle - React, Tailwind, and code Playground
HTML
<div id="chat-output" class="chat-output">
<div class="message-box">
<input id="text-box" placeholder="Say something nice..." type="text">
<input id="submit-button" type="submit" value="Submit">
</div>
</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;