DOM (Document Object Model) CSS (Cascading Style Sheets) Adapter Module for Base Library
Eric Bréchemier © 2011, Some Rights Reserved Legal-Box SAS © 2010-2011, All Rights Reserved
BSD License http://creativecommons.org/licenses/BSD/
2011-08-14
lb. | DOM (Document Object Model) CSS (Cascading Style Sheets) Adapter Module for Base Library |
Functions | |
getClasses(element): object | Get a hash of classes found on given DOM element. |
addClass(element, name) | Append a CSS class to the className of a DOM element. |
removeClass(element, name) | Remove a CSS class from the className of a DOM element. |
Get a hash of classes found on given DOM element.
element | DOM Element, an element node (with or without a class atribute) |
object, a hash object with properties named after the classes found, e.g.
{'big':true, 'box':true}
for
<div class='big box'></div>.
When no class attribute is present, or when it is empty, an empty object is returned.