ClassManager is a JavaScript utility for element classname manipulation, consisting of a static object providing the following ways of setting class names:
- Set different classnames to multiple elements.
- Set one class name to multiple elements
- Change all elements with a specified class name to another class name
- Toggle some or all elements between two class names.
Using colour-setting classes, the links below demonstrate the functions available on the elements displayed.
Access Instructions and Source Code
CONTENT
CONTENT
CONTENT
CONTENT
CONTENT
CONTENT
CONTENT
CONTENT
id 'div1' to 'blueBg' and id 'div2' to 'redBg' using ClassManager.setMultipleClasses
Class 'magBg' to div1/2/3/4 using ClassManager.setOneToMany
All with class 'yellbg' to class 'blackbg' using ClassManager.changeAll
All class 'blackBg' to 'redBg' using ClassManager.changeAll
Toggle all 'blackBg' / 'redBg' using ClassManager.toggleClass
"divC" to"redBg" and "div3" to "yellBg" using ClassManager.setMultipleClasses