on .bind('click') it is not deleting the first div
- by Jean
Hello,
When I click on a particular div, that div should fade out, simple, but when I click on one of the divs it deletes the div on top of the stack. ie., when I click #sel6 it removes sel5
html code
<div id="selc" class="selc" style="position:absolute; left:15px; top:200px; width:260px;">
<div id="sel5" class="sel">something</div>
<div id="sel6" class="sel">something</div>
<div id="sel7" class="sel">something</div>
</div
jquery code
sel_id, sel_1 are variables
$('.selc').bind('click',function(){
var sel_id = $('.sel').attr('id');
alert(sel_id);
$('#'+sel_id).fadeOut('slow');
$('#'+sel_id).remove();
$('.search_box').append(sel_1);
});
Thanks
Jean