I made an ajax request as below, but the request but it's not running. So I tried to 'console.log' but it's not working.
<input type="text" class="form-control" id="search">
<table class="table table-hover">
The above is the input field and below is the script tag.
<script type="text/javascript">
var base_url = "<?php echo base_url(); ?>";
$(document).ready(function(){
$("#search").keypress(function(){
console.log('ko') //this console is running
$.ajax({
console.log('ko') //this console is not running
// url:"<?php //echo base_url( 'Parts/search')?>",
type:'POST',
data:{
name:$("#search").val(),
},
success:function(data){
$("#output").html(data);
}
});
});
});
</script>