/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Change Text Color

Hello,

I want to change the text color from gray (for the default value Quick Search) to black when a user types their query. I’ve found lots of references to changing the background color, but could use some help changing just the text color.

[CODE]<input type=”text” maxlength=”255″ size=”11″ name=”searchdata1″ value=”Quick Search” onfocus=”if(this.value==this.defaultValue)this.value=”;” onblur=”if(this.value==”)this.value=this.defaultValue;” style=”color: #808080″>[/CODE]

Thanks in advance.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@FangJun 13.2007 — &lt;input type="text" maxlength="255" size="11" name="searchdata1" value="Quick Search" onfocus="if(this.value==this.defaultValue){this.value='';this.style.color='#000';};" onblur="if(this.value==''){this.value=this.defaultValue;this.style.color='#808080';}" style="color: #808080"&gt;
Copy linkTweet thisAlerts:
@cclibauthorJun 13.2007 — You da man/woman. Thanks again.
×

Success!

Help @cclib spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.5,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...