Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do i change text color dynamically

Status
Not open for further replies.

kuha

Technical User
Oct 23, 2001
14
US
Hi Friends,
How do i change the color of the text feilds dynamically.
Thanks for all the help.
Harish
 
You could set styles on your feilds and then control them with javascript

<script language=javascript>
document.divName.style.color:purple
</script>
</head>
<body>
<div name=divName>This is my text</div>
 
Shouldn't that be:
Code:
document.divName.style.color [b]=[/b] &quot;purple&quot;;
The colon is only used in <style> not <script>, and I think that you need the quotes around the value in a script. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Yes you are exactly right in the script it should be color=&quot;purple&quot; I must be sleeping at the wheel again.
Thanks Tracy.
 
Hmmm, nobody's perfect. I didn't realize that the bold tags wouldn't work properly inside code tags. How do other posters get bold, colors, etc. in their code postings?
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Do you have the checkmark for Process TGML checked under the message window. Other than that I thought Bold text would work.
 
Yes, I have the Process TGML text box checked. Always have had. Bold text works fine normally, but apparently not within [ code ] tags. BUT, I've seen people use bold and colored text within code before. Maybe they weren't using the code tags around it. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top