Skip to content

Selected element in devtools console

chromefirefox

You can use $0 in the console to refer to the currently selected element in the elements panel. This is extremely useful as you don't have to copy the CSS selector to refer to the element in the console.

You can also use $1, $2, $3, and $4 to refer to the previously selected elements. I rarely use these, but they can be useful in some cases.

Read more about this feature: