activate search function (part 3 of 3: js)