src/utilities/dom-class-list/index.js
function addClass( element ) {
  const addClassNamesArray = _sliceArgs( arguments );
  if ( hasClassList ) {
    element.classList.add.apply( element.classList, addClassNamesArray );
  } else {
    var classes = element.className.split( ' ' );
    addClassNamesArray.forEach( function( name ) {
      if ( classes.indexOf( name ) === -1 ) {
        classes.push( name );
      }
    } );
    element.className = classes.join( ' ' );
  }

  return element;
}
function addClass( element ) {
  const addClassNamesArray = _sliceArgs( arguments );
  if ( hasClassList ) {
    element.classList.add.apply( element.classList, addClassNamesArray );
  } else {
    var classes = element.className.split( ' ' );
    addClassNamesArray.forEach( function( name ) {
      if ( classes.indexOf( name ) === -1 ) {
        classes.push( name );
      }
    } );
    element.className = classes.join( ' ' );
  }

  return element;
}
function addClass ( element ) { const addClassNamesArray = _sliceArgs ( arguments ) ; if ( hasClassList ) { element . classList . add . apply ( element . classList , addClassNamesArray ) ; } else { var classes = element . className . split ( ' ' ) ; addClassNamesArray . forEach ( function ( name ) { if ( classes . indexOf ( name ) === - 1 ) { classes . push ( name ) ; } } ) ; element . className = classes . join ( ' ' ) ; } return element ; }
Add CSS class from an element.

@param {HTMLNode} element - A DOM element.
@param {string} className - CSS selector.
@returns {HTMLNode} element - A DOM element.
Add CSS class from an element .