JSFiddle - React, Tailwind, and code Playground
HTML
<div class="chatboxlink"><br />
<a href="Charles" id="1">Charles</a><br />
<a href="Randy" id="2">Randy</a><br />
<a href="Ben" id="3">Ben</a><br />
<a href="William" id="4">William</a><br />
<a href="George" id="5">George</a><br />
<a href="Karl" id="6">Karl</a><br />
<a href="Denis" id="7">Denis</a><br />
<a href="John" id="8">John</a><br />
<a href="Victor" id="9">Victor</a><br />
<a href="Andrew" id="10">Andrew</a><br />
</div>
CSS
.chatboxlink{width:25%; padding:auto;height:350px; }
.chatboxlink a{ display:block; padding:0px 5px 0px 5px; width:15%;height:10px;}
.chatbox{ width:250px; height:250px; background:#CCFFFF; float:right; bottom:-190px; position:relative; right:0px; border:1px solid #993300;}
.chatbox textarea{ height:80px; width:240px;overflow-y:auto scroll; resize:none; }
.chatbox p{ text-align:center; font-size:16px; color:#99FF99;}
.chatinput{ border-top:2px solid #00FF99; height:60px;width:250px; bottom:40px; position:absolute; float:left; margin-left:0; }
#title{ padding:5px; text-align:left; border:1px solid #3366FF; height:25px; }
#chatmessage{ background:#99CC99;height:155px;width:250px; top:0px; position:relative; overflow:auto scroll;}
JavaScript
$(document).ready(function(){
$('.chatboxlink a').click(function(){
var $user= $(this).attr('href');
var $id = $(this).attr('id');
var ids = $('[id="'+this.id+'"]');
if(ids.length>1 && ids[0]==this)
{
$('textarea').focus();
alert("Already chatting with "+$user);
}
else
{
$('body').append('<div class="chatbox" id='+ $id +'><div id="title"> ' + $user + ' </div><div id="chatmessage"></div><div class="chatinput"><textarea></textarea></div></div>');
}
return false;
});
});