15.02.2013 Views

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 1 ✦ Generic HTML Element Objects (Chapter 15)<br />

function colorAll() {<br />

for (var i = 0; i < document.all.length; i++) {<br />

document.all[i].style.color = “red”<br />

}<br />

}<br />

function colorChildBearing() {<br />

for (var i = 0; i < document.all.length; i++) {<br />

if (document.all[i].canHaveChildren) {<br />

document.all[i].style.color = “red”<br />

}<br />

}<br />

}<br />

<br />

<br />

<br />

canHaveChildren Property Lab<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Your basic checkbox<br />

<br />

<br />

<br />

<br />

<br />

<br />

QuantityDescriptionPrice<br />

<br />

<br />

<br />

4Primary Widget$14.96<br />

<br />

<br />

10Secondary Widget$114.96<br />

<br />

<br />

<br />

<br />

<br />

7<br />

elementObject.canHaveChildren

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!