javascript get array of class names

JavaScript
//get array of class names in Javascript
var classesArray = document.getElementById('myElementID').className.split(/\s+/);
Source

Also in JavaScript: