JSFiddle - React, Tailwind, and code Playground
by Ashish Kasama
HTML
<div id='bottom'></div>
JavaScript
var count = 0;
function chat(mem_id) {
count++;
var div_new = "<div style='position:absolute; width:200px; bottom:0px; left:10px;'>";
div_new = div_new+"<div style='width:100%; background-color:green;'>top "+ mem_id +" - "+count+"</div>";
div_new = div_new+"<div style='width:100%; height:300px; background-color:pink;'>bottom // refresh_chat"+ mem_id +" ";
var name = "send_chat_"+mem_id;
var url = "send_chat.php";
div_new = div_new+"<form name='"+name+"' onsubmit=\"return refresh(" + name +","+ url+",document.forms[name][name].value , '', '', 'refresh');\" + method='post' style='display:inline;'>";
div_new = div_new+"<textarea name='"+name+"' autofocus=autofocus placeholder='"+name+"'></textarea><input type=submit value=' send '>";
div_new = div_new+"</form>";
div_new = div_new+"</div>";
div_new = div_new+"</div>";
bottom = div_new;
document.getElementById('bottom').innerHTML = bottom;
}
chat(0);