11.12.2012 Views

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

JavaScript 2.0-The Complete Reference, Second ... - freecodingtutorial

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

}<br />

// If they previously clicked, switch that element back to normal<br />

if (prevObj)<br />

{<br />

}<br />

switchAppearance(prevObj);<br />

if (e.target) // DOM<br />

{<br />

}<br />

prevObj = e.target;<br />

switchAppearance(e.target);<br />

else if (e.srcElement) // IE<br />

{<br />

}<br />

prevObj = e.srcElement;<br />

switchAppearance(e.srcElement);<br />

function switchAppearance(obj)<br />

{<br />

obj.style.backgroundColor = ((obj.style.backgroundColor ==<br />

"lightblue") ?

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

Saved successfully!

Ooh no, something went wrong!