debbieau1
asked on
How to change the colour of a text box when clicked
Can anyone tell me how to change the colour of a text box on a form, when it is clicked. I am not sure if I needed to post this in the javascript area, or if it can be done in CSS which I would prefer.
thank you
Debbie
thank you
Debbie
ASKER
Hi thanks for your quick response.
The hello world example worked great but I couldnt' get it to work on my text box. I would be grateful if you could give me a little more help if you don't mind.
thank you very much
Debbie
The hello world example worked great but I couldnt' get it to work on my text box. I would be grateful if you could give me a little more help if you don't mind.
thank you very much
Debbie
> I couldnt' get it to work on my text box.
What's a text box? You mean a form element of type text? or a textarea?
<input type="text" value="hello world" onclick="this.style.color= 'red'"><br >
<textarea onclick="this.style.color= 'red'">hel lo world</textarea>
Please post your code if this does not solve your problem.
What's a text box? You mean a form element of type text? or a textarea?
<input type="text" value="hello world" onclick="this.style.color=
<textarea onclick="this.style.color=
Please post your code if this does not solve your problem.
ASKER
sorry, here is my code (I have increased the points, which I hope makes up for the extra effort you are giving.
<input name="glossarybox" type="text" id="glossarybox" size="25">
I would like the background or border to change colour when the tick box is clicked. I have a css style applied to the default input box.
thank you for all your help
Debbie
<input name="glossarybox" type="text" id="glossarybox" size="25">
I would like the background or border to change colour when the tick box is clicked. I have a css style applied to the default input box.
thank you for all your help
Debbie
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Exactly what I needed. Thank you so much!!
Debbie
Debbie
<:°)
<div onclick="this.style.color=
hello world
</div>