Sys.UI.DomElement toggleCssClass Method
Toggles a CSS class in a DOM element. This member is static and can be invoked without creating an instance of the class.
Syntax
Sys.UI.DomElement.toggleCssClass(element, className);
|
Term
|
Definition
|
|
element
|
The Sys.UI.DomElement object to toggle.
|
|
className
|
The name of the CSS class to toggle.
|
Remarks
Use the toggleCssClass method to hide a CSS class of an element if it is shown, or to show a CSS class of an element if it is hidden.
Example
The following example shows how to use the toggleCssClass method. This code is part of a larger example found in the DomElement class overview.
cs
// Toggle CSS class
Sys.UI.DomElement.toggleCssClass(eventElement.target, "redBackgroundColor");
vb
// Toggle CSS class
Sys.UI.DomElement.toggleCssClass(eventElement.target, "redBackgroundColor");