-2

I am using keyup event for autosearch from text field. But it triggers twice. If I bind method use it called once but in some pages it called twice.

$('#tc-header-sticky-search-input').on("keyup input", function(e){});

$(document).on('keyup ','#tc-header-sticky-search-input', function(e){});

I used both above . But no success

Carsten Løvbo Andersen
  • 26,637
  • 10
  • 47
  • 77

1 Answers1

-1

$('#contact-search-input').keyup(function () {
  console.log(this.value);
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input id="contact-search-input" type="text" placeholder="Search Data">
Ravi Ashara
  • 1,177
  • 7
  • 16