473,698 Members | 2,393 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to refer to a pseudo-class with JavaScript?

1 New Member
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 1349
acoder
16,027 Recognized Expert Moderator MVP
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
4449
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 refer script to track (after the closing </html> tag): <?php include '<?php echo dirname($_SERVER) ?>/refer.php' ?> Doing so results in the following error on any pages that have the
4
2189
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 --price MARKET --repeats 20 etc However, I'd like to add a mode that will handle, say:
1
1813
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 values? Or is it a parsed data only thing? BTW, new to XML; sorry if this is a dumb question. I just haven't seen this explicitly stated anywhere (though by experience it doesn't seem to work).
1
1774
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. here is the problem
70
6250
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 using the high-order bits returned by rand() instead of the low-order bits, avoiding using rand() for anything that wants decently random numbers, not using rand() if you want more than approx. UINT_MAX total different sequences, and so on. So I...
0
1128
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 pairs. However, I have been reading this: http://www.w3.org/TR/2000/WD-css-style-attr-20001025
3
2513
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 a pseudo driver, what would the first parameter ?i.e the device name.How to get it? Am new to device drivers. Plz help me in this aspect. Thanks a lot in advance!! Regards, skt.
4
3288
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: example.com/users/paul (displaying the user profile of "paul") or example.com/pictures/landscapes/13 (displaying pictures from the category "landscapes", page 13). These are just examples, I hope I didn't confuse you.
9
3290
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 PHP saint'; ?> Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com/
3
4768
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 terminal which to an application looks and acts like a regular com port (tty device in Linux-ease). The purpose of such a thing is to allow an application which communicates via a com port to remain the same (except for changing its com port...
0
8676
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9029
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8897
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8867
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7732
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6522
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2006
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.