Windows Library for JavaScript control attributes

Windows Library for JavaScript provides attributes that you can use to declare and configure WinJS controls in your HTML markup.

To use a WinJS control, you create an HTML element and use the data-win-control attribute to specify the type of control you want. For example, to add a ToggleSwitch control, you add a DIV element and set the data-win-control attribute to "WinJS.UI.ToggleSwitch". To set the control's properties, you use the data-win-options attribute.

In this section

Attribute Description

data-win-bind attribute

Binds a property of an element to a property of a data source.

data-win-control attribute

Makes a div element host the specified WinJS control.

data-win-fragmentLoad attribute

Deprecated. This attribute is not intended to be used in new Windows Store apps.

data-win-options attribute

Sets the specified properties and values for a WinJS control.

data-win-res attribute

Binds a property of an element to a property of a resource, for localization and other purposes.

data-win-selectable attribute

Specifies that the element is selectable. By default, all input elements and elements with the contentEditable attribute set to true are selectable. Other elements must have this attribute to be selectable.