doc: Merged/updated old docs for Element.addClassName

This commit is contained in:
tjcrowder 2009-10-09 14:14:14 +01:00
parent 7df62ce864
commit 77832408bd
1 changed files with 17 additions and 1 deletions

View File

@ -756,8 +756,24 @@ Element.Methods = {
/**
* Element.addClassName(@element, className) -> Element
* - className (String): The class name to add.
*
* Adds a CSS class to `element`.
* Adds the given CSS class to `element`.
*
* ##### Example
*
* Assuming this HTML:
*
* language: html
* <div id="mutsu" class="apple fruit"></div>
*
* Then:
*
* $('mutsu').className;
* // -> 'apple fruit'
* $('mutsu').addClassName('food');
* $('mutsu').className;
* // -> 'apple fruit food'
**/
addClassName: function(element, className) {
if (!(element = $(element))) return;