try like this, if you want the div to be blank, put like this $('.mydiv').html('');
$('#title').on('keyup',function(){
let $value = $(this).val();
$.ajax({
type : 'get',
url : '{{URL::to('similarpost')}}',
data:{'search':$value},
success:function(data){
if(data != null){
$('.mydiv').html(data);
}else{
$('.mydiv').html('');
}
}
});
})
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…