Hi everyone,
why my 2nd,3rd,4th line arent working in js source ?
$(document).ready(function(){
$('.cls').click(function(){
$('.mwindow').hide();
});
$('.frnd').on('click', function(){
var name=$(this).attr("id");
var div_mwindiow = document.createElement('div');
var div_hwindiow = document.createElement('div');
var span_hwindiow = document.createElement('span');
div_mwindiow.className ="mwindow";
div_hwindiow.className ="hwindow";
span_hwindiow.className ="cls";
var x = document.createTextNode('x');
span_hwindiow.appendChild(x);
div_hwindiow.appendChild(span_hwindiow);
var t = document.createTextNode(name);
div_hwindiow.appendChild(t);
div_mwindiow.appendChild(div_hwindiow);
document.body.appendChild(div_mwindiow);
//div_mwindiow.appendChild(div_hwindiow);
});
});
body{
margin:0;
background-color:#999;
height:700px;
}
.frnd{
text-align:center;
width:50px;
height:20px;
display:inline-block;
background-color:#9B59B6;
margin:5px;
border:4px solid #3498DB;
color:#F1C40F;
cursor:pointer;
float:right;
}
.mwindow{
width:150px;
height:200px;
border:2px solid #16a085;
}
.mwindow{
width:140px;
height:25px;
background-color:#1abc9c;
padding:5px;
}
.cls{
display:inline-block;
float:right;
cursor:pointer;
font-size:20px;
font-weight:bold;
}
<span id="Maxi" class="frnd">Maxi</span><br/>
<span id="John" class="frnd">John</span><br/>
<span id="Henry" class="frnd">Henry</span><br/>
<span id="Max" class="frnd">Max</span><br/>
<span id="Simon" class="frnd">Simon</span><br/>