Watch JavaScript values in real time with Live Expressions

Sofia Emelianova
Sofia Emelianova

If you find yourself typing the same JavaScript expression in the Console repeatedly, you might find it easier to create aLive Expression.WithLive 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 theConsole:

  1. Open the Console.
  2. ClickCreate Live Expression.Create Live Expression.TheLive Expressiontext box appears.

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

    Typing document.activeElement into the Live Expression text box.

  4. PressEnterto save the expression, or click outside of theLive Expressiontext 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 theCreate a live expression.Create Live Expressionbutton 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 theThe Close button.Closebutton next to it.