Helper function that returns an array of classes from a DOM element