15.02.2013 Views

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

JavaScript Examples Bible - UserWorks Technologies

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

42 <strong>JavaScript</strong> <strong>Examples</strong> <strong>Bible</strong>: The Essential Companion to <strong>JavaScript</strong> <strong>Bible</strong><br />

Listing 15-15 (continued)<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

runtimeStyle<br />

NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5<br />

Compatibility ✓ ✓<br />

Example<br />

Use The Evaluator (Chapter 13 in the <strong>JavaScript</strong> <strong>Bible</strong>) to compare the properties<br />

of the runtimeStyle and style objects of an element. For example, an unmodified<br />

copy of The Evaluator contains an EM element whose ID is “myEM”. Enter both<br />

document.all.myEM.style.color<br />

and<br />

document.all.myEM.runtimeStyle.color<br />

into the top text field in turn. Initially, both values are empty. Now assign a color to<br />

the style property via the upper text box:<br />

document.all.myEM.style.color = “red”<br />

If you now type the two earlier statements into the upper box, you can see that<br />

the style object reflects the change, while the runtimeStyle object still holds<br />

onto its original (empty) value.<br />

scopeName<br />

elementObject.scopeName<br />

NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5<br />

Compatibility ✓ ✓

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

Saved successfully!

Ooh no, something went wrong!