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

前端 未结 3 550
鱼传尺愫
鱼传尺愫 2021-01-29 19:53

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

3条回答
  •  时光说笑
    2021-01-29 19:54

    For xpath searches use $x('xpathSelector'). For a css selector use $('cssSelector').

    However, this last selector returns only the first matching element. If you want to see all matching elements go for $$('cssSelector')

提交回复
热议问题