Availability: |
| |||
Property/method value type: | style object | |||
JavaScript syntax: | IE | myStyle.item(anIndex) | ||
IE | myStyle.item(aSelector) | |||
IE | myStyle.item(aSelector, anIndex) | |||
Argument list: | anIndex | A zero based value in accordance with the length attribute of the style object. | ||
aSelector | A textual value that selects all matching objects |
You will have to use some JavaScript to inspect the values presented by this mechanism. The following lines both yield a FONT-SIZE object:
document.all.tags("HTML")[0].currentStyle.item(0)
document.all.tags("TITLE")[0].currentStyle.item(0)
The style object in both cases only has a single item in its collection and so the length values for these expressions always yield 1 for a simple document:
document.all.tags("HTML")[0].currentStyle.length
document.all.tags("TITLE")[0].currentStyle.length
If you begin to explore the MSIE browser in this way, there are many undocumented properties and object references which are reasonably easy to figure out because of their names. However some are quite obscure. We have tried to cover as many as we can. Discovering undocumented method calls is far more difficult and you may need to reverse engineer the JScript interpreter to discover the names of the methods that are implemented.
See also: | Collection.Item() |
Prev | Home | Next |
style.important | Up | style.layoutGrid |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |