#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    21
    Rep Power
    0

    how can i change css


    hello all. I have a form with a field as follows-
    <INPUT size=20 maxLength=63 name=myfield>

    the following style sheet is on the page also-
    <style type="text/css">
    INPUT { color:red; }
    </style>

    Upon loading the page I populate the field with a calculated value..This appears in RED due to the style sheet.

    How might I change the style of the field after the it has been automativcally populated onload(), so that anything typed after the value would be for example written in BLUE? any ideas.

    Kind Regards Toks.
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    21
    Rep Power
    0
    ----
    theRules = document.styleSheets[0].rules;
    theRules[0].style.color = 'blue';
    ----
    changes the loaded value to blue, i require both colours in the field at same time....

IMN logo majestic logo threadwatch logo seochat tools logo