JavaScript - Selecting Elements In The Console
September 11, 2019
The DevTools console provides you with shorterned element selectors to quicken your workflow.
Listed below are three variables and their explanations:
- $0 - $4 : A history of the five most recent DOM elements that you’ve selected in the elements panel, $0 being the last.
- $$() : A shortened version of document.querySelectorAll() which returns an array of the given CSS selector.
- $() : A shortened version of document.querySelector() which returns the first element, matching a given CSS selector.