搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

Learn More

What syntax does the search feature in Developer tools use?

  • 1 回覆
  • 1 有這個問題
  • 19 次檢視
  • 最近回覆由 user1929

more options

The search boxes in the inspector window window returns no results whenever I try to search for specific key-value pairs like: role="main".

I can only get results for main or role. Is there a search string parameter/syntax reference anywhere? I've searched high and low, but articles/references found in the documentation is VERY basic.

Thanks

The search boxes in the inspector window window returns no results whenever I try to search for specific key-value pairs like: role="main". I can only get results for main or role. Is there a search string parameter/syntax reference anywhere? I've searched high and low, but articles/references found in the documentation is VERY basic. Thanks

被選擇的解決方法

Hi,

I'm not aware of any documentation for it, although there might be something. As far as I can tell, you can typically just search for a string of text, but this won't work in some cases, like what you've found. You can also type CSS selectors to find elements, which works a lot better - for your example, you could use this CSS selector:

[role="main"]

Hope that helps!

從原來的回覆中察看解決方案 👍 1

所有回覆 (1)

more options

選擇的解決方法

Hi,

I'm not aware of any documentation for it, although there might be something. As far as I can tell, you can typically just search for a string of text, but this won't work in some cases, like what you've found. You can also type CSS selectors to find elements, which works a lot better - for your example, you could use this CSS selector:

[role="main"]

Hope that helps!