Would be helpful to know what the actual error it is you are getting And a snippet of code is not really that helpful unfortunately as well. Like where is the proper variable declaration for searchBox for example, but that could be at the top, but we would not know etc.