Console

The Console developer tool in Microsoft Edge logs information that's associated with a webpage, such as JavaScript, network requests, and security errors. You can use the Console for interactive debugging and ad hoc testing.

To open the Console tool in Microsoft Edge, press the F12 key to access the developer tool window (or right-click on the page, and then select Inspect Element). Then, select the Console tab at the top of the window.

You can also use the Console tool to communicate to and from a running webpage. You can use the Console to:

  • Post standard error and status codes and informational messages as your code runs.
  • Generate custom debug logs from the Console API calls you include in your code.
  • Provide a command line and interactive tree view for inspecting current return values of key variables and functions.

Parts of the Console

The following image shows the key parts of the Console:

The Microsoft Edge DevTools console

  1. Errors / Warnings / Info / Logs buttons: Filter console output by the specified type. You can multi-select buttons by holding down the Ctrl key. The All button clears all filters.

  2. Clear button (Ctrl+L): The Clear button clears the current console display.

  3. Preserve Log check box: Selecting the Preserve Log check box persists your console output across page refreshes and closing and reopening DevTools. The Console history clears only when the tab is closed or you manually clear the Console.

  4. Target: Use the Target drop-down menu to switch to a different execution context, such as an