Using the classes function and Array contains for hasClass without ClassList