Overview Open Chrome DevTools What's New in DevTools DevTools tips Simulate mobile devices with Device Mode Performance insights: Get actionable insights on your website's performance Lighthouse: Optimize website speed Animations: Inspect and modify CSS animation effects Changes: Track your HTML, CSS, and JavaScript changes Coverage: Find unused JavaScript and CSS CSS Overview: Identify potential CSS improvements Issues: Find and fix problems Media: View and debug media players information Memory Inspector: Inspect ArrayBuffer, TypedArray, DataView, and Wasm Memory. Network conditions: Override the user agent string Security: Understand security issues Search: Find text across all loaded resources Sensors: Emulate device sensors WebAuthn: Emulate authenticators Customize DevTools Engineering blog
Overview Open Chrome DevTools What's New in DevTools DevTools tips Simulate mobile devices with Device Mode Performance insights: Get actionable insights on your website's performance Lighthouse: Optimize website speed Animations: Inspect and modify CSS animation effects Changes: Track your HTML, CSS, and JavaScript changes Coverage: Find unused JavaScript and CSS CSS Overview: Identify potential CSS improvements Issues: Find and fix problems Media: View and debug media players information Memory Inspector: Inspect ArrayBuffer, TypedArray, DataView, and Wasm Memory. Network conditions: Override the user agent string Security: Understand security issues Search: Find text across all loaded resources Sensors: Emulate device sensors WebAuthn: Emulate authenticators Customize DevTools Engineering blog

Watch JavaScript values in real-time with Live Expressions

Published on Updated on

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. 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.
    Important

    To type a multi-line expression, start the new line by pressing Shift+Enter.

  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 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.

Remove expressions

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

Updated on Improve article

We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.