Solved

Javascript - Changing label background color

Posted on 2007-04-01
2
2,081 Views
Last Modified: 2012-06-21
I am using javascript and C# ASP.net.  I am wanting to change the color of a label within a function in JavaScript.  It is a specific label that I want to make a specific color within the function.   How can I do this?

Thanks
0
Comment
Question by:vandy02
  • 2
2 Comments
 
LVL 26

Accepted Solution

by:
DireOrbAnt earned 250 total points
ID: 18834251
// To change the font's color
document.getElementById("LabelId").color = "red";
0
 
LVL 26

Expert Comment

by:DireOrbAnt
ID: 18834253
Make that:
document.getElementById("LabelId").style.color = "red";
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now