Post date: Dec 9, 2013 10:59:43 AM
Необходимы jquery и twitterBootsrap. (можно без bootstrap) Для <input class='erasable'>
$(".erasable").keyup(function(){
var id = $(this).attr('id');
if($(this).val() != ''){
if(!$("#cl_"+id).length){
$("<span id='cl_"+id+"' class='icon-remove-circle erease' style='position: absolute; margin-top: 8px!important; margin-left: -20px;'></span>").insertAfter($(this));
}
} else {
if($("#cl_"+id).length){
$("#cl_"+id).remove();
}
}
});
$('body').on('click', '.erease', function(){
var id = $(this).attr('id').substr(3);
$('#'+id).val('');
$(this).remove();
});