?
Solved

Reference CSS from Javascript

Posted on 2003-03-22
3
Medium Priority
?
191 Views
Last Modified: 2013-11-19
I had a page that I was dynamically changing link colors with a button that did the following:

onChange="document.linkColor='#ff0000';"

We now have CSS selectors at the top of the page, including:

a:link {  color: #660099}

The question: Is there any way to reference that CSS selector from Javascript to change the page link colors dynamically?


Thanks
0
Comment
Question by:enogma
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Accepted Solution

by:
cerebus19 earned 300 total points
ID: 8188968
Yes, there is.  Unfortunately, the way to do it is not the same in every browser.  See this page for a good explanation of how to do it (with easily modifiable cross-browser script, yet):

http://www.xs4all.nl/~ppk/js/changess.html

-Matt
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
Any person in technology especially those working for big companies should at least know about the basics of web accessibility. Believe it or not there are even laws in place that require businesses to provide such means for the disabled and aging p…
The is a quite short video tutorial. In this video, I'm going to show you how to create self-host WordPress blog with free hosting service.
Suggested Courses

801 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