Links
- Using the console API
- Console API Reference
- Command Line API Reference
- $_ | $0 - $4
- $(selector) | $$(selector) | $x(path)
- copy(object)
- dir(object)
- dirxml(object)
- inspect(object)
- Opens and selects the specified element or object in the appropriate panel: either the Elements panel for DOM elements and the Profiles panel for JavaScript heap objects.
- getEventListeners(object)
- keys(object) | values(object)
- monitorEvents(object[, events])
| unmonitorEvents(object[, events])
- e.g.
monitorEvents($("#msg"), "key");
– see all keyboard events on that element such as keydown, keyup, keypress, textinput, etc.
- e.g.
Formatting
From String substitution and formatting
Formats for console.log
Format specifier | Description |
---|---|
%s |
Formats the value as a string. |
%d or %i |
Formats the value as an integer. |
%f |
Formats the object as a floating point value. |
%o |
Formats the value as an expandable DOM element (as in the Elements panel). |
%O |
Formats the value as an expandable JavaScript object. |
%c |
Applies CSS style rules to output string specified by the second parameter. |