Login box - how to add different color

Discussion in 'HTML & Website Design' started by webbusiness23, Jul 12, 2009.

  1. #1
    Hi,

    i'd like to know how can i customize a login box.

    I want it to change it's background color when a user clicks on it in order to type his nickname.

    Thanks!
     
    webbusiness23, Jul 12, 2009 IP
  2. garrettheel

    garrettheel Peon

    Messages:
    341
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You'd need to use javascript to listen for the click event on the input box and then change the CSS class of the box accordingly.
     
    garrettheel, Jul 12, 2009 IP
  3. webbusiness23

    webbusiness23 Member

    Messages:
    153
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #3
    I've managed to change the background color of the input's background with the onClick function.

    But how can i revert the change? I mean what function do i use for the color to change back after the user clicks on something else?

    LATER EDIT:

    I've managed to do what i wanted.

    Here's the solution:


    onfocus="javascript:this.className='clicked_style';" onblur="javascript:this.className='initial_style';"
     
    webbusiness23, Jul 13, 2009 IP