Reading a value of a class aplied to an HTML element 
Author Message
 Reading a value of a class aplied to an HTML element

Does existe any way to read the values into  the class atribute aplied to a
element?
Foe example, I define an style:
<style type="text/css">
<!--
.mainSt {  position: absolute; color: #FFFFFF; background: #0066FF;
text-decoration: none; height: 20px}
-->
</style>
Then, in the body I put
<DIV ID="Layer1" CLASS="mainSt"> This is the content of the DIV</div>

I want to read the value of height or background, for instance, but when I
try get it using document.all.Layer1.style.height it doesn't contain any
value!.

Any answer?



Sun, 21 Sep 2003 02:42:17 GMT  
 Reading a value of a class aplied to an HTML element
Try
  document.all.Layer1.currentStyle.height

Quote:

> Does existe any way to read the values into  the class atribute aplied to a
> element?
> Foe example, I define an style:
> <style type="text/css">
> <!--
> .mainSt {  position: absolute; color: #FFFFFF; background: #0066FF;
> text-decoration: none; height: 20px}
> -->
> </style>
> Then, in the body I put
> <DIV ID="Layer1" CLASS="mainSt"> This is the content of the DIV</div>

> I want to read the value of height or background, for instance, but when I
> try get it using document.all.Layer1.style.height it doesn't contain any
> value!.

> Any answer?


--

        Martin Honnen
        http://javascript.faqts.com/
        http://home.t-online.de/home/martin.honnen/jsgoddies.html



Sun, 21 Sep 2003 20:50:34 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. passing an element name (of an object/class) to a sorting routine

2. Find more than one elements by one class name

3. ?Selecting/Indexing Options elements by Name value

4. how to set the value of a File element

5. ?Selecting/Indexing Options elements by Name value

6. Changing the value of a form element?

7. changing the value of a hidden element

8. ?Selecting/Indexing Options elements by Name value

9. Capturing Form element values

10. Change the value of an element in the array

11. Updating table element values...

12. How to get one element value from variant whose subtype is array

 

 
Powered by phpBB® Forum Software