Keyup function loses functionality on ajax page update

Keyup function loses functionality on ajax page update

Im using keyup function to track text typed in input box. The idea is to perform incremental search in db. This works fine. After this I update the html dynamically to display the filtered resuts and at the same time I must dynamically rewrite the html for  input box code. After this the keyup function is not working anymore, allthough the id tag is the same?  How should I get around this?
  1.  $('#filterBox').keyup(function() {
  2.             $('#status').text(this.value.length)
  3.             if (this.value.length > 2) {
  4.                 filter($.trim(this.value));
  5.             }
  6.         });