473,387 Members | 1,407 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.

Are style properties held in an array?

Just learning here, so maybe I'm way off, but...
I was originally under the impression that css style properties could
be accessed/ listed since they exsisted as an array somewhere.

Is this just flat out wrong?

To illustrate - I guess I thought something like this could be used to
list available/ or set properties, or in this example the first
property. Is this just a fantasy? Or how does this work, at this level
or for document objects even?

//assuming <div id="menu"></div> exisists and hs styles applied....

document.write(document.getElementById('menu').sty le[0]);

//of course this is wrong...
Jul 20 '05 #1
1 2098


Nairb wrote:
Just learning here, so maybe I'm way off, but...
I was originally under the impression that css style properties could
be accessed/ listed since they exsisted as an array somewhere.

Is this just flat out wrong?

To illustrate - I guess I thought something like this could be used to
list available/ or set properties, or in this example the first
property. Is this just a fantasy? Or how does this work, at this level
or for document objects even?

//assuming <div id="menu"></div> exisists and hs styles applied....

document.write(document.getElementById('menu').sty le[0]);


DOM Level 2 style defines the style object property to have its own
property named length and to have an item method which in the ECMAScript
binding can be called by using square bracket indexing.
Netscape 6+ and Opera 7 implement it this way, however IE5/6 don't
provide the length property nor the item method.
Anway, in your example (<div id="menu"></div>) there is no inline style
thus the length property would be zero.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 20 '05 #2

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

Similar topics

0
by: Nairb | last post by:
Just learning here, so maybe I'm way off, but... I was originally under the impression that css style properties could be accessed/ listed since they exsisted as an array somewhere. Is this just...
8
by: Tim Pollard | last post by:
Hi I am trying to filter a table of users to select only those records whose roleID matches a value in an array. There could be any number of IDs held in the array from one to a few hundred. The...
15
by: lawrence | last post by:
Sorry for the dumb question but I'm new to Javascript. I wrote this script hoping to animate some div blocks on a page. You can see the page here: http://www.keymedia.biz/demo.htm Can anyone...
3
by: joealey2003 | last post by:
Hi all... I included a css file on my html and i need to check some properties. The html is: <style id="myid" src="mycsspage.css"> </style> Now i need something to access it like: ...
9
by: JimO | last post by:
I'm a newbie at this and I can't seem to find a list properties names to change styles on the fly. So far I've been lucky and managed to guess the names such as BodyElement.style.marginTop = 0;...
3
by: C# Learner | last post by:
Should constant class member variables be held like this: public class Foo { public const int ConstVar = 100; } Or like this: public class Foo
4
by: terrorix | last post by:
I have create Style class instance and set up properties like this: Style st = new Style(); st.BackColor = Color.Black; st.BorderColor = Color.White; st.BorderStyle = BorderStyle.Solid;...
4
by: Davids | last post by:
in my small hangman web project I have a Hangman class which has some methods and properties (int GuessAttempts, string GuessedLetters etc..) which change as the game goes on... Best of all would...
3
by: Dan | last post by:
Is it possible to dynamically create and populate properties? Below is my class. I would like to define properties for each of the items in my two arrays without actually defining each one. (There...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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.