Feel free to ask any questions.
<div class="popup">
<button class="chatBtn" onclick= "showed()">Chat</button>
</div>
<div class="popupwindow">
<h2>Chat Box</h2>
<p>Feel free to ask any questions.</p>
<textarea name="chat" id="chat" rows="8" cols="19"></textarea>
<div class="popupbtn">
<button>Send</button>
<button class="close" onclick="this.parentElement.parentElement.style.display='none'">Close</button>
</div>
</div>
function showed(){
let popupwindow=document.querySelector(".popupwindow");
let x=getComputedStyle(popupwindow);
console.log(x);
if(x.display=='none'){
popupwindow.style.display="block";
}
}
.popup{
position: fixed;
top:92vh;
right:10px;
z-index: 10;
}
.chatBtn,.popupbtn button{
border: none;
background-color: dodgerblue;
padding: 14px 16px;
color: white;
font-size: 17px;
cursor: pointer;
}
.popupwindow{
max-width: 180px;
position: fixed;
top: 45vh;
z-index: 11;
right: 10px;
background-color: #333;
color: white;
padding: 5px;
display: none;
}
textarea{
padding: 3px;
}
.popupbtn button{
width: 100%;
}
.popupbtn .close{
background-color: red;
}
.chatBtn:hover,.popupbtn button:hover{
opacity: 0.8;
}