change contains to search javascript function