473,399 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Change Input and Select background

Hello,

I have seen some Inputs and Selects which change color when I place
the mouse inside to write or when I click to select an item.

Is this done only with CSS? How can I do this?

Thanks,
Miguel

Jun 3 '07 #1
3 9261
On Jun 3, 3:32 pm, shapper <mdmo...@gmail.comwrote:
Hello,

I have seen some Inputs and Selects which change color when I place
the mouse inside to write or when I click to select an item.
<input type="text" onfocus="this.color='black'"
onblur="this.color='gray'" >
Is this done only with CSS? How can I do this?
input{color:gray}
input:focus{color:black}
but this will not work in <=IE6

Jun 3 '07 #2
On Jun 3, 5:11 pm, "scripts.contact" <scripts.cont...@gmail.com>
wrote:
I have seen some Inputs and Selects which change color when I place
the mouse inside to write or when I click to select an item.

<input type="text" onfocus="this.color='black'"
onblur="this.color='gray'" >

<input type=text
onfocus="this.style.color='black'"
onblur="this.style.color='gray'"
style="color:gray"
>
Jun 3 '07 #3
scripts.contact wrote:
>
input:focus{color:black}
but this will not work in <=IE6
:active works the same in IE as :focus in other browsers

--
Berg
Jun 4 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: chichi | last post by:
Hi there! I was wondering if somebody could tell me how to edit the following ASP code so that the text within the tables appears as Font Color "00FF00". Right now it is appearing in BLACK and...
1
by: thilo | last post by:
hi ng! i need to change the (inline) style-setting - ie the "style=" attribute - for an html-<input> by client-side script, according to the "value" of another <input>. i declared it like that...
13
by: Gary | last post by:
I have a table with a form consisting of several checkboxes and I'm wondering if its possible to change the table row background color on mouseover or hover and make it stay that color when the...
3
by: Bundy | last post by:
Hi How do I change the background colour of an input box in a form as soon as the value is changed? Also the background should revert back to it's original colour if the user decides that they...
10
by: IchBin | last post by:
I am trying to set the state of a radio button. I do not see what I am doing wrong. Sorry, I am new at this.. I need another set of eyes to look at this snip of code. I am trying to set the radio...
1
by: roshina | last post by:
Hi Iam facing a problem in my project, developing a web site for online shopping in ASP on windows XP using IIS server. All the validations are ok but the new password is not upadated in the data...
2
by: 1ontherun | last post by:
Hi, Here's the problem. I am trying to allow the user to change a page background to an image file on their computer. The input box is already a 'type=file', however it uses the character "\"...
3
by: helraizer1 | last post by:
Hi all, On one page of my site I have a form (code below) with an input textbox with the id "message". You type in your message in this field (as the id suggests) and depending on an option in a...
10
omerbutt
by: omerbutt | last post by:
hi there i am working on an inventory rpoject and for that i have made a stock entry form which is pasted below,I have included this form in the main Add Stock page, having the following inputs to be...
4
by: html | last post by:
Hello all, I need to change the colour of my text. For the paragraph I do document.fgColor ="blue" ; but how do I do this for the select tags? ....and I prefer it to apply to all select tags...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.