code: function contains( element, className ) {
    className = className.replace( '.', '' );
    if ( hasClassList ) {
      return element.classList.contains( className );
    }
  
    return element.className.indexOf( className ) > -1;
  }
docs: Determine if element has particular CSS class.
  
  @param {HTMLNode} element - A DOM element.
  @param {string} className - CSS selector.
  @returns {boolean} True if `element` contains class `className`.