December 2013
Intermediate to advanced
480 pages
14h 11m
English
If you want to retrieve a single element from a document, instead of matching a set of elements, then you can use the WinJS.Utilities.id() method. For example, the following line of code changes the background color of an element to the color red:
WinJS.Utilities.id("message").setStyle("background-color", "red");
The statement matches the one and only element with an id of message. For example, the statement matches the following DIV element:
<div id="message">Hello!</div>
Notice that you do not use a hash when matching a single element with the WinJS.Utilities.id() method. You would need to use a hash when using the
Read now
Unlock full access