#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2004
    Posts
    4
    Rep Power
    0

    Adding Form Javascript to a class.


    Is something like this possible, if yes, what's the correct format?

    input, textarea, button, select
    {
    font-size: 8pt;
    font-weight: bold;
    onfocus="this.style.background='#DDDDDD'";
    onblur="this.style.background='#EFEFEF'";
    color: #000000;
    background-color: #EFEFEF;
    border: 1px solid #CCCCCC;
    font-family: Tahoma, arial, helvetica, serif;
    }
  2. #2
  3. Thanks Johnny Hart (BC) R.I.P.

    Join Date
    May 2003
    Location
    Dallas
    Posts
    5,262
    Rep Power
    1960
    The onevent is an html attribute. It is applied to the element tag.
    Code:
    <select id=""
            onfocus="this.style.background='#dddddd';"
            onblur="this.style.background='#efefef';">
    cheers,

    gary
    There are those who manage to build a web site without knowing what they're doing; thereby proving to themselves they do, indeed, know what they're doing.

    My html and css workshop, demos and tutorials.
    Ask a better question, get a better answer.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2004
    Posts
    4
    Rep Power
    0
    Yes I know.

    So I must modify each of the fields one by one to get the effect? No other global way?
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Posts
    7
    Rep Power
    0

    sure


    That is really very troublesome
  8. #5
  9. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,124
    Rep Power
    4309
    Spreading knowledge, one newbie at a time.

    Learn CSS. | PHP includes | HTML Validator | CSS validator

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).

IMN logo majestic logo threadwatch logo seochat tools logo