Difference between revisions of "$$"

From FirebugWiki
Jump to: navigation, search
(Separate Command Line API page for $$())
 
m (Added categories)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
This command returns an array of HTML or XML elements that match the given CSS selector. This means it is actually a shortcut for <code>[https://developer.mozilla.org/en/DOM/Document.querySelectorAll document.querySelectorAll()]</code>.
 
This command returns an array of HTML or XML elements that match the given CSS selector. This means it is actually a shortcut for <code>[https://developer.mozilla.org/en/DOM/Document.querySelectorAll document.querySelectorAll()]</code>.
 +
 +
== Syntax ==
 +
<source lang="javascript">
 +
$$(selector)
 +
</source>
  
 
== Parameters ==
 
== Parameters ==
Line 6: Line 11:
  
 
== Examples ==
 
== Examples ==
 
 
<source lang="javascript">
 
<source lang="javascript">
 
$$(".someClass")
 
$$(".someClass")
Line 17: Line 21:
 
</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">
Line 24: Line 28:
  
 
This returns all checkboxes.
 
This returns all checkboxes.
 +
 +
== See also ==
 +
* [[Command Line API]]
 +
 +
[[Category:Firebug]]
 +
[[Category:UI]]
 +
[[Category:API]]

Latest revision as of 16:01, 21 November 2013

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().

Syntax[edit]

$$(selector)

Parameters[edit]

selector[edit]

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

Examples[edit]

$$(".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.

See also[edit]