From 77832408bdd6a8ce6e82eef9199ee031c6fbfecc Mon Sep 17 00:00:00 2001 From: tjcrowder Date: Fri, 9 Oct 2009 14:14:14 +0100 Subject: [PATCH] doc: Merged/updated old docs for Element.addClassName --- src/dom/dom.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/dom/dom.js b/src/dom/dom.js index bc047dc..9870c52 100644 --- a/src/dom/dom.js +++ b/src/dom/dom.js @@ -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 + *
+ * + * Then: + * + * $('mutsu').className; + * // -> 'apple fruit' + * $('mutsu').addClassName('food'); + * $('mutsu').className; + * // -> 'apple fruit food' **/ addClassName: function(element, className) { if (!(element = $(element))) return;