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

Manipulating CSS

Hi!

Just as I can manipulate DOM node with JavaScript - can I manipulate the
CSS classes?

CSS:

#myid
{
blah: 123;
}

Pseudo-JS:

myid.blah=321;
....and automatically, all tags with ID=myid will change.

Is this possible?
Jul 20 '05 #1
2 3148
/Timo Nentwig/:
Just as I can manipulate DOM node with JavaScript - can I manipulate the
CSS classes?


Take a look at the W3C's "DOM Level 2 Style" spec:

http://www.w3.org/TR/DOM-Level-2-Style/

There are two distinct chapters:

"Document Object Model Style Sheets"
http://www.w3.org/TR/DOM-Level-2-Style/stylesheets.html

"Document Object Model CSS"
http://www.w3.org/TR/DOM-Level-2-Style/css.html

where the first introduces some base interfaces used for any type of
style sheet and the second deals with CSS specifics.

.... and then probably you'll need to post to a scripting related group.

--
Stanimir
Jul 20 '05 #2
Timo Nentwig wrote:
Just as I can manipulate DOM node with JavaScript - can I manipulate the
CSS classes?

CSS:

#myid
{
blah: 123;
}

Pseudo-JS:

myid.blah=321;

...and automatically, all tags with ID=myid will change.

Is this possible?


For DOM-compliant clients:

Document Object Model (DOM) Level 2 Style Specification
http://www.w3.org/TR/DOM-Level-2-Style/
For IE:

styleSheet Object
http://msdn.microsoft.com/workshop/a...stylesheet.asp

rule Object
http://msdn.microsoft.com/workshop/a...jects/rule.asp

style Object
http://msdn.microsoft.com/workshop/a.../obj_style.asp

--
Steve

Each snowflake in an avalanche pleads not guilty. -Stanislaw J. Lec
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Michael J. Astrauskas | last post by:
Does anyone have a function for manipulating GET variables in a URL? I want to be able to modify some parameters without affecting others. An example of what I'm looking for: Let's say the...
12
by: agent349 | last post by:
Hi, I'm fairly new to c++. I need user input in the form of dollar amounts, ie: "$10.00". I'd like to remove the dollar sign "$" then store the rest in a variable. How do I go about removing the...
10
by: Kristian Nybo | last post by:
Hi, I'm writing a simple image file exporter as part of a school project. To implement my image format of choice I need to work with big-endian bytes, where 'byte' of course means '8 bits', not...
2
by: Santa | last post by:
Hello: I am trying to manipulating the data from the pointer (the below program) in the function "test1", Is there any best way of changing the data from that pointer (I am changing by assigning...
1
by: Barb Alderton | last post by:
I am working with SharePoint 2003. I am using an existing webpart as a child control (server control). I need to access/manipulate the HTML that the control outputs prior to rendering it to the...
2
by: Don Wash | last post by:
Hi There! How do I manipulate folders in Outlook Express (Not Outlook)? I need to read messages in the mail folders as well as newsgroups. I've search on the net but all I found is how to send...
0
by: Yohancef Chin | last post by:
Does anyone know of a resource that gives the syntax commands for manipulating word through Javascript/VBscript? Thanks.
1
by: Oleg Ogurok | last post by:
Hi all, I've just realized that static data are not thread safe because they are shared by all users of the ASP.NET application. What if a static method is passed an object variable? Do I still...
1
by: Donal McWeeney | last post by:
Hi, Any pointers to manipulating client side validation being performed. For example I have a custom control that does a postback to the server - and I dont want validation to be performed...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
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...

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.