I want to fire input's on.input
event if value is changed not by typing
Type something inside the input and then click the button
$('.inpsearch').on('input', function(){
let a = $(this).val();
console.log(a);
});
$('button').on('click', function(){
$('.inpsearch').val('');
// console.log expected here
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input type='search' class='inpsearch'>
<button>CLICK</button>