changing background color of a cell

Discussion in 'Javascript' started by effendi@epitome.com.sg, Mar 27, 2005.

  1. Guest

    Sorry to ask this again. There has been quite a bit of post on this.

    I have table with cells with the classes workspaces. The table has not
    background color but onmouseover I changed the cell backgroundColor to
    blue. I have to do something similar on mouseout to "remove" the blue
    since my table is transparent, how do I accomplish that?

    Thanks in advance.
     
    , Mar 27, 2005
    #1
    1. Advertising

  2. wrote:


    > I have table with cells with the classes workspaces. The table has not
    > background color but onmouseover I changed the cell backgroundColor to
    > blue. I have to do something similar on mouseout to "remove" the blue
    > since my table is transparent, how do I accomplish that?


    How about setting
    element.style.backgroundColor = 'transparent';
    ?
    Or simply
    element.style.backgroundColor = '';
    if you want to remove the inline style setting. That will only work if
    you did
    element.style.backgroundColor = 'blue';
    before, not if you set some style class or manipulated a rule in a
    stylesheet.



    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
     
    Martin Honnen, Mar 27, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hal Vaughan
    Replies:
    5
    Views:
    30,165
  2. Chanman
    Replies:
    0
    Views:
    1,007
    Chanman
    Jun 19, 2008
  3. RJ
    Replies:
    1
    Views:
    261
    Eliyahu Goldin
    Feb 17, 2005
  4. Kamaljeet Saini
    Replies:
    0
    Views:
    506
    Kamaljeet Saini
    Feb 13, 2009
  5. Arthur Shapiro
    Replies:
    29
    Views:
    350
    Arthur Shapiro
    Jan 2, 2005
Loading...

Share This Page