Elements inspector

suggest change

In Chrome’s Elements tab or Firefox’s Inspector, the “select an element” button, then a click on an element, highlights it and assigns it to $0 in the console.

The inspector can be used in a variety of ways, for example:

  1. You can check if your JS is manipulating DOM the way you expect it to,
  2. You can more easily debug your CSS, when seeing which rules affect the element

(Styles tab in Chrome)

  1. You can play around with CSS and HTML without reloading the page.

Also, Chrome remembers last 5 selections in the Elements tab. $0 is the current selection, while $1 is the previous selection. You can go up to $4. That way you can easily debug multiple nodes without constantly switching selection to them.

$0 through $4 are console helpers, not JavaScript variables in the page. See Chrome’s console utilities.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents