[thelist] Javascript: altering BG color of multiple divs with one click

Dunstan Orchard dunstan at 1976design.com
Tue Nov 11 09:54:06 CST 2003


Hi there,

I wonder if anyone could put on their best Javascript Pants and take a look at
this problem for me:

http://www.1976design.com/dev/divcolor/

In a nutshell: I have a set of six divs. I'd like to be able to click on any one
div and have its background-color change. It would then stay changed until
another div was clicked on, at which point it would return to the default color
and the new div's color would change, and so on...

I'd also like to be able to click on a div and have it alter the color of other
divs. For example, clicking on Div 3 would alter its color and that of Div 1.

Can anyone help out?

Thanks very much - Dunstan

---------------------------
Dorset, England
http://www.1976design.com/
http://www.1976design.com/blog/


More information about the thelist mailing list