После клонирования DOM элемента не могу его-же удалить. Почему ?
Lynn «Кофеман»:
<script type="text/javascript">
$('.del_tel').click(function(){
p=$(this).parent();
p.remove();
})
</script>
<script type="text/javascript">
$('.add_tel').click(function(){
var $cont = $('.phone');
var $clone = $cont.find('p:last').clone().appendTo('.phone');
$clone.find('.datepicker').attr("id",'').removeClass('hasDatepicker').datepicker();
});
</script>
<div class="user col-sm-12 telefon">
<label>Телефон:</label>
<div class="form-group">
<div class="col-md-12">
<div class="phone">
<p>
<label class="col-sm-6">
<input class="form-control pull-right" data-inputmask="'mask':'(999) 999-99-99'" data-mask="data-mask" name="tel[]" value=" (862) 264-44-64" type="text"></label>
<label class="col-sm-6">
<input class="form-control pull-right" name="tel2[]" value="" type="text"></label>
<a type="button" title="Удалить" class="btn btn-danger del_tel btn-xs"><i class="glyphicon glyphicon-minus"></i></a>
</p><p>
<label class="col-sm-6">
<input class="form-control pull-right" data-inputmask="'mask':'(999) 999-99-99'" data-mask="data-mask" name="tel[]" value=" (862) 264-44-64" type="text"></label>
<label class="col-sm-6">
<input class="form-control pull-right" name="tel2[]" value="" type="text"></label>
<a type="button" title="Удалить" class="btn btn-danger del_tel btn-xs"><i class="glyphicon glyphicon-minus"></i></a>
</p><p>
<label class="col-sm-6">
<input class="form-control pull-right" data-inputmask="'mask':'(999) 999-99-99'" data-mask="data-mask" name="tel[]" value=" (862) 264-44-64" type="text"></label>
<label class="col-sm-6">
<input class="form-control pull-right" name="tel2[]" value="" type="text"></label>
<a type="button" title="Удалить" class="btn btn-danger del_tel btn-xs"><i class="glyphicon glyphicon-minus"></i></a>
</p></div>
</div> <small></small>
</div>
</div>