December 2013
Intermediate to advanced
480 pages
14h 11m
English
The WinJS.Utilities.children() method enables you to retrieve a QueryCollection which contains all of the children of a DOM element. For example, imagine that you have a DIV element which contains children DIV elements like this:
<div id="discussContainer"> <div>Message 1</div> <div>Message 2</div> <div>Message 3</div></div>
You can use the following code to add borders around all of the child DIV elements and not the container DIV element (see Figure 2.8):
var discussContainer = WinJS.Utilities.id("discussContainer").get(0);WinJS.Utilities.children(discussContainer).setStyle("border", "2px dashed red");
FIGURE 2.8 Retrieving children ...
Read now
Unlock full access