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 supported client

Windows 8 [Windows Store apps only]

Minimum supported server

Windows Server 2012 [Windows Store apps only]

Minimum supported phone

Windows Phone 8.1

Namespace

WinJS.Utilities

Library

Base.js

 

 

Show:
© 2014 Microsoft