Dev Tools - Searching Elements in the DOM Elements Tab

09/09/2023, Sat
Categories: #browser
Tags: #dev-tools

Jump to Specific Elements in the Dom Viewer

Within the "Inspector" or "Elements" (depending if you are using Firefox or Chrome) Html node viewer tab's input search field, you can use a xpath selector to select a group of elements with the following.

//element-type

This will search for all a tags.

//a

To narrow down the elements based on their type and attribute, prefix the attribute with the @ character along with the attribute value. Then place the attribute and value into square brackets.

//div[@id='container']