« Back to the index

WA.get, direct access to nodes examples


There are 2 methods to access the nodes fetched by the get:
WA.get.node() : returns the FIRST DOM node found.
WA.get.nodes() : returns ALL the DOM nodes found in an array.

Let's play with some objects:
function test1() { var nall = WA.get('.cd1').nodes(); for (var i = 0, l = nall.length; i < l; i++) nall[i].style.border = '2px solid black'; var nunique = WA.get('#d1').node(); nunique.innerHTML = 'XX'; WA.get("#d2").node().style.left = '170px'; WA.get("#d3").node().style.left = '190px'; }
Show the result



« Back to the index