[Javascript] Javascript arrays

Mike Dougherty mdougherty at pbp.com
Thu May 6 08:12:34 CDT 2004


>Rather than explictly changing an element's backgroundColor in Javascript, I recommend that you 
>change its className instead, and set the color specifics in your stylesheet.  If you can confine 
>as many of your stylistic effects as possible to css, you'll always know where to go to tweak the 
>cosmetic and you won't have to worry about css/javascript conflicts.

   How do you deal with multiple properties using that strategy?  If i want to change both the 
background color (for enable/disable) and font-weight (for select/deselect) - is there a way to 
use CSS class, without having to define 4 classes for this one object?

   I like the idea of controlling display with css, but taking everything "out" to the style sheet 
makes the inline code a bit less readable.  (ok, so i'm lazy too)



More information about the Javascript mailing list