469,323 Members | 1,543 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,323 developers. It's quick & easy.

change input font color

oll3i
679 512MB
how do I change input font color?
thank You
Feb 23 '08 #1
3 12408
ronverdonk
4,258 Expert 4TB
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
Feb 24 '08 #2
hsriat
1,654 Expert 1GB
OR

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

Expand|Select|Wrap|Line Numbers
  1. document.getElementsByTagName('input').color = '#ff0000';
Feb 24 '08 #3
acoder
16,027 Expert Mod 8TB
OR

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

Expand|Select|Wrap|Line Numbers
  1. document.getElementsByTagName('input').color = '#ff0000';
Not quite. document.getElementsByTagName('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.
Feb 25 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by nitindutt2005 | last post: by
7 posts views Thread by =?Utf-8?B?QnJpYW4gQ29vaw==?= | last post: by
omerbutt
10 posts views Thread by omerbutt | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by mdpf | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.