I am trying to retrieve the class names (and hence use it) of an element that i am retrieving using the target.closest() method. However when i try to apply classNames