How to search DOM elements using XPath or CSS selectors in Chrome Developer Tools?

Bobo picture Bobo · Apr 14, 2011 · Viewed 67.2k times · Source

The doc http://code.google.com/chrome/devtools/docs/elements.html says it supports XPath or CSS selectors, but when I tried, didn't seem to work for me.

Any one knows how to use it?

Answer

Matt Polito picture Matt Polito · Aug 29, 2011

You can use $x in the Chrome javascript console. No extensions needed.

ex: $x("//img")