Documentation for: ASP.NET Ajax Version 1.0

This documentation is for a previous version. For the current released version, see the ASP.NET Ajax documentation on MSDN.

 

 

 

 

 

 

 

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");