Exploring WinJS controls and styles

Windows library for JavaScript provides a rich set of controls, databinding options, and promises and in this section we will explore a few popular controls and styling options.

None of the WinJS controls have separate markup, instead WinJS library provides several attributes that can be used with the existing HTML elements.

Adding WinJS controls

As we have seen, there are no any markups for WinJS controls and they can be added through attributes on the HTML elements. WinJS controls can be added by adding any HTML element and setting its data-win-control attribute value to the name of the WinJS control.

In the following example, we are changing a simple HTML button element into the back button usually seen in store ...

Get JavaScript for .NET Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.