Click to See Complete Forum and Search --> : how i get Class properties ?


izikon
08-31-2003, 05:01 AM
i have this script:

<style>
.myClass {
width:100%;
left:0px;
}
</style>

<div class="myStyle" id="myDiv">
blah blah
</div>

<script>
alert(myDiv.style.width)
</script>


the alert return blank
how can i get the class properties
when i using in elemnt style attribute the alert
return me the property i need
but i need to use class and not style attributes
because i'm using dynamic classes inside my page

please help me!!....
Izikon

Khalid Ali
08-31-2003, 07:21 AM
you will need to read about

document.styleSheets

and rules in IE and cssRules in NS