$$

From FirebugWiki

(Difference between revisions)
Jump to: navigation, search
(Separate Command Line API page for $$())
m
Line 17: Line 17:
</source>
</source>
-
This returns all <code>span</code>s being direct children of elements having the class <code>someClass</code> assigned.
+
This returns all <code>&lt;span&gt;</code>s being direct children of elements having the class <code>someClass</code> assigned.
<source lang="javascript">
<source lang="javascript">

Revision as of 22:35, 4 July 2012

This command returns an array of HTML or XML elements that match the given CSS selector. This means it is actually a shortcut for document.querySelectorAll().

Parameters

selector

Selector used to match the elements to return. This follows the syntax of document.querySelectorAll(). (required)

Examples

$$(".someClass")

This returns all elements having the class someClass assigned.

$$(".someClass > span")

This returns all <span>s being direct children of elements having the class someClass assigned.

$$("input[type=checkbox]")

This returns all checkboxes.

Personal tools