Alex Rivera | Logout

Is there an addon which you can test css selectors in firefox?

Asked 2010-02-05T16:50:39.090
57

I was wondering if there is such an addon in firefox where you can test out css paths to check if they are finding the correct element? I was looking for something similar to xpather for xpath locations.

Edit
Report

2 Answers

57

Edit 2019-12-04:

The firefinder addon no longer exists, but you can use the developer console (press F12), and the $$ function to get elements matching a selector, eg. to select all divs: $$('div')

Old answer:

FireFinder does exactly what you are looking for. You can evaluate either CSS, or XPath expressions, it will list the matching elements, and also draw a red border around them.

FireFinder

answered 2010-02-05T16:57:12.707
2

The DOM standard function document.querySelectorAll is what you want, modern browser all support it. See the document

https://developer.mozilla.org/en-US/docs/DOM/Document.querySelectorAll

You can call it in built-in web console. In console there is a shortcut $$, call it like $$('div a').

I like firebug because it can click to scroll to view the element. It also can test in 'CSS' panel.

answered 2013-02-19T08:00:48.860

Your Answer