this is so simple and I searched but couldn't find the exact answer.
All I want to do is have a div that will change color when you click a link. I want to have about 3 or 4 color choices. How do I do it?
Thanks!
this is so simple and I searched but couldn't find the exact answer.
All I want to do is have a div that will change color when you click a link. I want to have about 3 or 4 color choices. How do I do it?
Thanks!
Heres a quick solutions
Demo: http://jsfiddle.net/jnAem/
JS:
HTML:
Note that if you want all color changers to be children of same element, you can use event delegation and reduce the previous code to
JS:
HTML:
Demo: http://jsfiddle.net/jnAem/1/