You can use the onChange property to execute a function when the value of the search bar changes.
onChange