Check if element has a class
@param  {Element}  element
@param  {String}  className
@return {boolean}
function hasClass(element, className) {
  if (!element || !('className' in element)) {
    return false;
  }

  return element.className.split(/\s+/).indexOf(className) !== -1;
}