function hasClass(element, className) {
  if (!element || !('className' in element)) {
    return false;
  }

  return element.className.split(/\s+/).indexOf(className) !== -1;
}
function hasClass(element, className) {
  if (!element || !('className' in element)) {
    return false;
  }

  return element.className.split(/\s+/).indexOf(className) !== -1;
}
function hasClass ( element , className ) { if ( ! element || ! ( 'className' in element ) ) { return false ; } return element . className . split ( / \s+ / ) . indexOf ( className ) !== - 1 ; }
Check if element has a class
@param  {Element}  element
@param  {String}  className
@return {boolean}
Check if element has a class