Adds a class name to a given DOM element.
@method addClass
@for DOM
@param {HTMLElement} element The DOM element.
@param {String} className the class name to add to the class attribute
762826
function(node, className) {
        if (!Y.DOM.hasClass(node, className)) { // skip if already present 
            node.className = Y.Lang.trim([node.className, className].join(' '));
        }
    }
790047
public function addClass($className)
    {
        $existingClasses = !empty($this->attributes['class'])
            ? explode(' ',$this->attributes['class'])
            : array();
        $existingClasses[] = $className;
        $this->attributes['class'] = implode(' ', array_unique($existingClasses));
    }
24330
protected function addClassToSubpackage($classname, $element)
    {
        $subpackageName = PHPUnitUtil::getSubpackageName($classname);

        $subpackage = $this->getSubpackageElement($subpackageName);

        if ($subpackage === null) {
            $subpackage = $this->doc->createElement('subpackage');
            $subpackage->setAttribute('name', $subpackageName);
            $this->doc->documentElement->appendChild($subpackage);
        }

        $subpackage->appendChild($element);
    }
1171197
function addClass(className) {
  if (typeof className === 'undefined') {
    return this;
  }
  const classes = className.split(' ');
  for (let i = 0; i < classes.length; i += 1) {
    for (let j = 0; j < this.length; j += 1) {
      if (typeof this[j] !== 'undefined' && typeof this[j].classList !== 'undefined') this[j].classList.add(classes[i]);
    }
  }
  return this;
}
679108
public void addClassElement(final String className, final MetadataElement classElement) {
        classElement.setType(getNamespaceValue(classElement.getType()));

        if (classElement.getMaxOccurs() != null && !classElement.getMaxOccurs().equals("1")) {
            classElement.setMaxOccurs("unbounded");
        }

        for (MetadataItem item : classList) {
            if (item.getName().equals(className) && item.getNamespace().equals(getCurrentNamespace())
                && item.getPackageApi().equals(getCurrentPackageApi())) {
                // check for a element with the same name, if found then set 'maxOccurs = unbounded'
                for (MetadataElement element : item.getElements()) {
                    if (element.getName().equals(classElement.getName()) && !classElement.getIsAttribute()) {
                        element.setMaxOccurs("unbounded");
                        return;
                    }
                }

                item.getElements().add(classElement);
                return;
            }
        }

        final MetadataItem newItem = new MetadataItem(className);
        newItem.getElements().add(classElement);
        newItem.setNamespace(getCurrentNamespace());
        newItem.setSchemaName(getCurrentSchmema());
        newItem.setPackageApi(getCurrentPackageApi());
        newItem.setPackageImpl(getCurrentPackageImpl());
        classList.add(newItem);
    }
1309587
function addClasses(element, classNames) {

  var classes = domClasses(element);

  var actualClassNames = isArray(classNames) ? classNames : classNames.split(/\s+/g);
  actualClassNames.forEach(function(cls) {
    classes.add(cls);
  });
}
1230523
function addElClass(element, classToAdd) {
  if (element.classList) {
    element.classList.add(classToAdd);

    // Don't need to `throwIfWhitespace` here because `hasElClass` will do it
    // in the case of classList not being supported.
  } else if (!hasElClass(element, classToAdd)) {
    element.className = (element.className + ' ' + classToAdd).trim();
  }

  return element;
}
578535
function(elem, className) {
            // the className can potentially come from the search results, so make sure it is valid before
            // attempting to insert it...

            // if the className doesn't start with a letter or a '-' followed by a letter, don't insert
            if(!/^[-]?[A-Za-z]/.test(className)) {
                return;
            }
            // now filter out anything that is not a letter, number, '-', or '_'
            className = className.replace(/[^A-Za-z0-9_-]/g, "");
            if(this.hasSVG) {
                if(elem.className.baseVal) {
                    elem.className.baseVal += " " + className;
                }
                else {
                    elem.className.baseVal = className;
                }
            }
            else {
                $(elem).addClass(className);
            }
        }
1255164
private void addToCreateElements(String elementName) {
        HashMap<String, String> elementAttributes = new HashMap<>();

        elementAttributes.put(XsdAbstractElement.NAME_TAG, elementName);

        if (!createdElements.containsKey(getCleanName(elementName))){
            createdElements.put(getCleanName(elementName), new XsdElement(null, elementAttributes));
        }
    }
272141
function addClass(node, name) {
        if (hasClass(node, name)) {
            return;
        }
        if (node.classList) {
            node.classList.add(name);
        } else {
            node.className += " " + name;
        }
    }
427458
@XmlAttribute(name="name", required=true)
    public void setClassName(String className) {
        ArgUtils.notEmpty(className, "className");
        this.className = className;
    }
930827
function( cls ) {
				var classes = this.getCustomData( 'classes' );
				if ( !this.hasClass( cls ) ) {
					!classes && ( classes = [] ), classes.push( cls );
					this.setCustomData( 'classes', classes );
					this.addClass( cls );
				}
			}
401202
function addClass( element, cssClass ) {
   if( element.classList ) {
      element.classList.add( cssClass );
      return;
   }
   element.className += ` ${cssClass}`;
}
871315
function hasClass(element, className) {
    !!/\s/.test(className) ? "development" !== 'production' ? invariant(false, 'CSS.hasClass takes only a single class name.') : invariant(false) : void 0;
    if (element.classList) {
      return !!className && element.classList.contains(className);
    }
    return (' ' + element.className + ' ').indexOf(' ' + className + ' ') > -1;
  }
1310739
public void addElement(ObjectProperty element) {
        assertNotNull(element);
        if (elements == null) {
            elements = new ArrayList<ObjectProperty>();
        }
        elements.add(element);
        element.setParent(this);
    }
414823
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;
}
206697
function (el, cls) {
        cls = getString(cls);
        if (!cls) return;
        if (Array.isArray(cls)) {
            cls.forEach(function(c) {
                dom.addClass(el, c);
            });
        } else if (el.classList) {
            el.classList.add(cls);
        } else {
            if (!hasClass(el, cls)) {
                if (el.classList) {
                    el.classList.add(cls);
                } else {
                    el.className += ' ' + cls;
                }
            }
        }
    }