Working in the Console

One of the most useful parts of the DevTools is the console, which lets you enter JavaScript code and evaluate it immediately. This is especially useful for iteratively developing JavaScript code that makes changes to a page.

In the DevTools, click on the Console tab, to the right of the Elements tab (Figure 6.5).

Figure 6.5  Choosing the console tab

Choosing the console tab

The console has a prompt where you can enter lines of code. Click to the right of the Choosing the console tab symbol so that the console is ready for input (Figure 6.6).

Get Front-End Web Development: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.