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.

422<br />

(IE) event.type<br />

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

Listing 29-17 (continued)<br />

document.styleSheets[0].rules[0].style.color = “”<br />

} else {<br />

elem.style.color = “”<br />

}<br />

}<br />

<br />

<br />

<br />

srcElement Property<br />

<br />

One event handler...<br />

<br />

Can<br />

Cover<br />

Many<br />

Objects<br />

<br />

<br />

Lorem ipsum dolor sit amet, consectetaur adipisicing elit,<br />

sed do eiusmod tempor incididunt<br />

ut labore et dolore magna aliqua.<br />

Ut enim adminim veniam, quis nostrud<br />

exercitation ullamco laboris nisi ut aliquip ex ea<br />

commodo consequat.<br />

<br />

<br />

<br />

type<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 see values returned by<br />

the type property. Enter the following object name into the bottom text box and<br />

press Enter/Return:<br />

event<br />

If necessary, scroll the Results box to view the type property, which should read<br />

keypress. Now click the List Properties button. The type changes to click. The<br />

reason for these types is that the event object whose properties are being shown

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

Saved successfully!

Ooh no, something went wrong!