Skip to main content
WinJS.Utilities.removeClass function

Applies to Windows and Windows Phone

Removes the specified class from the specified element.

Syntax


var htmlElement = WinJS.Utilities.removeClass(e, name);

Parameters

e

Type: HTMLElement

The element from which to remove the class.

name

Type: string

The name of the class to remove.

Return value

Type: HTMLElement

The element.

Examples

The following code shows how to use this function.


<div id="div1"></div>
<script type="text/javascript">
    var firstElement = document.getElementById("div1");
    WinJS.Utilities.addClass(firstElement, "testClass");
    var element = WinJS.Utilities.removeClass(firstElement, "testClass");
    var hasClass = WinJS.Utilities.hasClass(firstElement, "testClass");
</script>

Requirements

Minimum WinJS version

WinJS 1.0

Namespace

WinJS.Utilities