[ Web Proxy ]
URL:
Viewing: https://developer.chrome.com/docs/devtools/console/live-expressions [Back]  [Original]

Watch JavaScript values in real time with Live Expressions  |  Chrome DevTools  |  Chrome for Developers Skip to main content
Chrome for Developers [Chrome for Developers]

Watch JavaScript values in real time with Live Expressions Stay organized with collections Save and categorize content based on your preferences.

Sofia Emelianova [Sofia Emelianova]
Sofia Emelianova

If you find yourself typing the same JavaScript expression in the Console repeatedly, you might find it easier to create a Live Expression. With Live Expressions, you type an expression once and then pin it to the top of your Console. The value of the expression updates in near real time.

Create a live expression

To pin an expression to the top of the Console:

  1. Open the Console.
  2. Click Create Live Expression. [Create Live Expression.] Create Live Expression. The Live Expression text box appears.

  3. Type your expression in the text box. For example, you can use a live expression to track element focus.

    Typing document.activeElement into the Live Expression text box. [Typing document.activeElement into the Live Expression text box.]

    Key point: To type a multi-line expression, start the new line by pressing <kbd>Shift</kbd>+<kbd>Enter</kbd>.
  4. Press Enter to save the expression, or click outside of the Live Expression text box.

The value below the pinned expression is its result. The result updates every 250 milliseconds.

Add multiple expressions

To pin multiple expressions in parallel, click the Create a live expression. [Create a live expression.] Create Live Expression button as many times as you need.

You can only see several pinned expressions at a time but you can scroll the expressions list to view all of them.

Scroll the pinned expressions list. [Scroll the pinned expressions list.]

Remove expressions

To remove an expression, click the The Close button. [The Close button.]Close button next to it.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2019-04-18 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2019-04-18 UTC."],[],[]]

Web Proxy Viewer  |  New URL  |  Original Page