1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Javascript to change the colour of form background

Discussion in 'JavaScript and AJAX' started by ihatec, Nov 23, 2010.

  1. ihatec

    ihatec New Member

    Joined:
    Sep 1, 2010
    Messages:
    20
    Likes Received:
    3
    Trophy Points:
    0
    Is it possible in Javascript to change the colour of form background?

    Let's say I have some text form and by default it has white background. But when I click on it I want to the colour to other one.

    I know there is an event onClick but is it also valid for such problem or I have to create my own event.
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,293
    Likes Received:
    365
    Trophy Points:
    83
    No on click event should work but if you have controls on the form you may see that clicking form elements does not work then you have to make those controls also call the same color changing JS function
     

Share This Page