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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.