1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

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,276
    Likes Received:
    364
    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