JSFiddle - React, Tailwind, and code Playground
by Tamil
HTML
<div id="widnow">
<div id="title_bar">
<div id="button">-</div>
</div>
<div id="box">
</div>
</div>
CSS
#widnow{
width:400px;
border:solid 1px;
}
#title_bar{
background: #FEFEFE;
height: 25px;
width: 100%;
}
#button{
border:solid 1px;
width: 25px;
height: 23px;
float:right;
cursor:pointer;
}
#box{
height: 250px;
background: #DFDFDF;
}
JavaScript
$("#button").click(function(){
if($(this).html() == "-"){
$(this).html("+");
}
else{
$(this).html(" - ");
}
$("#box").slideToggle();
});