Dir
From FirebugWiki
(Difference between revisions)
Sebastianz (Talk | contribs) (Separate Command Line API page for dir()) |
Sebastianz (Talk | contribs) m (Added 'dirxml' to the links) |
||
| (One intermediate revision not shown) | |||
| Line 1: | Line 1: | ||
| - | Prints an interactive listing of all properties of the object. This looks identical to the view that inside the [[DOM Panel]]. | + | Prints an interactive listing of all properties of the object. |
| + | |||
| + | This looks identical to the view that inside the [[DOM Panel]] and also shares the display options with it. I.e. if you have unchecked ''Show DOM functions'' for example, they also won't be shown in the output of this command. | ||
| + | |||
| + | == Syntax == | ||
| + | <source lang="javascript"> | ||
| + | dir(object) | ||
| + | </source> | ||
| + | |||
| + | == Parameters == | ||
| + | === object === | ||
| + | Object to display the properties for. '''(required)''' | ||
| + | |||
| + | == Examples == | ||
| + | <source lang="javascript"> | ||
| + | dir(document.body) | ||
| + | </source> | ||
| + | |||
| + | Lists all properties of the <code><body></code> element. | ||
| + | |||
| + | <source lang="javascript"> | ||
| + | dir(userDefinedProperty) | ||
| + | </source> | ||
| + | |||
| + | Lists all properties of the <code>userDefinedProperty</code> variable. | ||
| + | |||
| + | == See also == | ||
| + | * [[dirxml]] | ||
| + | * [[Command Line API]] | ||
Latest revision as of 10:59, 13 July 2012
Prints an interactive listing of all properties of the object.
This looks identical to the view that inside the DOM Panel and also shares the display options with it. I.e. if you have unchecked Show DOM functions for example, they also won't be shown in the output of this command.
Contents |
[edit] Syntax
dir(object)
[edit] Parameters
[edit] object
Object to display the properties for. (required)
[edit] Examples
dir(document.body)
Lists all properties of the <body> element.
dir(userDefinedProperty)
Lists all properties of the userDefinedProperty variable.