473,387 Members | 1,516 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,387 software developers and data experts.

How to refer to a pseudo-class with JavaScript?

1
I'm building a real-time layout tool where you can change for ex. font sizes and background colors directly by entering appropriate values into specified fields.

I'm using JQuery to target HTML-elements (such as body, h1, div etc.) like this:

Expand|Select|Wrap|Line Numbers
  1. $('#somediv').css("backgroundColor","#000000");
  2. $('a').css("color","#000000");
So, changing styles of body, titles, div tags etc. can be done easily, but how to refer to a a:link, a:hover, a:visited and a:active pseudo-classes with JavaScript?
Sep 19 '07 #1
1 1336
acoder
16,027 Expert Mod 8TB
To get the CSS rules, use cssRules (W3C) and rules (Microsoft). See, for example, change style sheets.
Dec 29 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Mike | last post by:
I've been trying to setup Dean Allen's excellent "Refer" script. (http://www.textism.com/tools/refer/) The instructions say to add this code to the bottom of whatever web pages you want the...
4
by: Andrew E | last post by:
Hi all I've written a python program that adds orders into our order routing simulation system. It works well, and has a syntax along these lines: ./neworder --instrument NOKIA --size 23...
1
by: 5tein | last post by:
I mean, with XSL functions such as SELECT can I only refer to XML element values or can I somehow also refer to XML attribute values? Is there any way to refer to XML content based on attribute...
1
by: rudderstick | last post by:
Hi there all, I have an interesting problem.... I work for a company that develops software for the building industry and would like to distribute one of our software products via the web. ...
70
by: Ben Pfaff | last post by:
One issue that comes up fairly often around here is the poor quality of the pseudo-random number generators supplied with many C implementations. As a result, we have to recommend things like...
0
by: Kevin Frey | last post by:
WebControl contains properties such as ControlStyle and Style for controlling the style of a web-control. In particular the Style property is a CssStyleCollection that simply comprises key-value...
3
by: shakthi | last post by:
Hi all. Am a beginner in device driver programming. Please tell me how to get handle for a pseudo driver..., a driver with no device connected i suppose.Am using CreateFile() win32 API. Since it is...
4
by: k3pp0 | last post by:
Hey. I've got a very basic newbie question, I hope you can understand me. Sorry for asking it, first of all. I see a lot of sites (e.g. communities) with a url-structure like this:...
9
by: R. Rajesh Jeba Anbiah | last post by:
I'm just wondering, what is the correct way to refer to "!important". I currently refer it is "not important"--but I guess, it's wrong. What is the correct way? TIA -- <?php echo 'Just another...
3
by: bytehunter | last post by:
Hello, I hope this is the best place to ask my question. I was wondering if there was such a thing as a pseudo terminal in Windows. For those unfamiliar, in Linux/Unix one can create a pseudo...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.