DOM inspector question

Discuss how to use and promote Web standards with the Mozilla Gecko engine.
Post Reply
yinglcs
Posts: 77
Joined: December 19th, 2005, 2:53 pm

DOM inspector question

Post by yinglcs »

Hi,

I would like to know the difference between
* JavaScript Object->Style->visibility and
* Computed Style->visibility

In some case, I see they have different value,
I see 'JavaScript Object->Style->visibility ' with the value ""
but Computed Style->visibility has the value 'hidden'

Why there is a difference?

Thank you.
Guest
Guest

Post by Guest »

JavaScript Object >Style > shows properties that are present in the style attribute of elements. For example:

Code: Select all

<p style="visibility: hidden">Hidden paragraph</p>

That value would be shown under JavaScript Object whereas this would not:

p {
  visibility: hidden
}


When you set CSS properties via Javascript, they are added to the style attribute of elements. This most likely explains why only those properties are seen there.
object.style.visibility="hidden";
Post Reply