change input font color

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • oll3i
    Contributor
    • Mar 2007
    • 679

    change input font color

    how do I change input font color?
    thank You
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Originally posted by oll3i
    how do I change input font color?
    thank You
    You can set it using CSS, like this:
    [html]<style>input {color: #ff0000;}</style>
    <input type="text" name="name" />[/html]
    Or do you need another method?

    Ronald

    Comment

    • hsriat
      Recognized Expert Top Contributor
      • Jan 2008
      • 1653

      #3
      OR

      if you are looking for DOM function, then try this..

      [CODE=javascript]document.getEle mentsByTagName( 'input').color = '#ff0000';[/CODE]

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Originally posted by hsriat
        OR

        if you are looking for DOM function, then try this..

        [CODE=javascript]document.getEle mentsByTagName( 'input').color = '#ff0000';[/CODE]
        Not quite. document.getEle mentsByTagName( 'input') would be an array of input fields, so you would have to loop over them to set the color and set it with style.color.

        Comment

        Working...