/    Sign up×
Community /Pin to ProfileBookmark

Changing colour in the field

I would like to change with JAVAscript the colour of the field if user goes into field in form.Do you help me and give me the code?

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Sep 09.2005 — <input type="text" name="t1" onfocus="this.style.color='red';this.style.backgroundColor='yellow';" onblur="this.style.color='black';this.style.backgroundColor='white';" />

Eric
Copy linkTweet thisAlerts:
@toplisekauthorSep 09.2005 — I hav eteh folllowing test code:

<form name="sporocilo" action="http://" target="_self">

<input type="text" name="t1" onfocus="this.color='#99FF66';this.backgroundColor='#66FFCC';" onblur="this.color='#336666';this.backgroundColor='#0033FF';" />

</form>

Should I change as it does not work...

i'm new to this, sorry, help...
Copy linkTweet thisAlerts:
@A1ien51Sep 09.2005 — whoops, did not have my coffee yet. I changed the code above, it was missing style.

Eric
×

Success!

Help @toplisek 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

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