vanilla js get class list into array code example Example: javascript get all classes var allHiddenElements = document.getElementsByClassName("hidden");