父节点的class="a" ,子节点的class="b",当点击子节点时删除父节点,
在function remove(){}里怎么实现,部分代码如下
var remove = function($el){
$el.remove();
};
$('.b').on('click' ,function(){
var $pel = $(this).parent();
remove($pel);
});
$('.b').click(function(){
$(this).closest('.a').remove()
})
function remove(){
$(this).parent().remove();
}