The HTML5 DOM Element API: classList08 Nov 2011
classList object is a set of functions that helps you manipulate the
class attribute on a node. It provides functionality that allows you to add a class to the node, remove a class, find out if a node contains a class, and lets you toggle a class. It is a pretty simple API to interact with so let us run through an example that uses the available functions.