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.
DOM inspector question
-
- Guest
JavaScript Object >Style > shows properties that are present in the style attribute of elements. For example:
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";
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";