JSFiddle - React, Tailwind, and code Playground
by webyourway
HTML
<div style="margin-top: 50px; background-size: cover; background-attachment: fixed; position: absolute; top: 0; left: 0; right: 0; bottom: 0">
<div style="width: 30%; left: 0; height: 100%; background-color: yellow; float: left; overflow: scroll"></div>
<div id="rightdiv" style="width: 70%; right: 0; height: 100%; background-color: red; float: left; overflow: scroll"></div>
</div>
<div style="position: fixed; bottom: 3px; width: 100%; background-size: cover; left: 0; text-align: center">
<div>
<input id="Text" type="search" value="Enter your Message here" style="font-size: 20px;width: 200px;" size="100" />
<input onclick="updatePageMsg(); return false;" id="SendBtn" type="button" value="Send" style="font-size: 20px; bottom: 6px" />
</div>
</div>
JavaScript
function updatePageMsg() {
var msg = document.getElementById("Text").value;
var divElement = document.createElement("div");
divElement.setAttribute("style", "background-size:cover; padding: 5px 5px 5px 5px");
var pElement = document.createElement("p");
pElement.innerHTML = msg;
divElement.appendChild(pElement);
rightDiv = document.getElementById("rightdiv");
rightDiv.appendChild(divElement);
document.getElementById("Text").value = null;
}
$(document).ready(function () {
$('#Text').keypress(function (e) {
if (e.keyCode == 13) {
$('#SendBtn').click();
return false;
}
});
});