Chromium Dioxide Chromium Dioxide - 1 year ago 81
CSS Question

opacity and style undefined when accesing element in js but defined in css

With this fiddle

why is the opacity undefined when accessed in js when its defined in the css?

I presume the answer is because the style is also undefined, why is that, does the style need adding somewhere explicitly before the opacity can be defined?

the lack of [] is a typo created as I copied from source to fiddle. The style/opacity problem still exits in the original code which is correct in that aspect.

Answer Source

should be:


since getElementsByTagName returns a nodeList.


This still doesn't get the value. You'll need to do the following:



Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download