$x
From FirebugWiki
Revision as of 10:46, 5 July 2012 by Sebastianz (Talk | contribs)
This command returns an array of HTML or XML elements matching the given XPath expression. This means it is actually a shortcut for document.evaluate().
Currently this command is limited to node arrays. See issue 18 for supporting other results to be printed.
Contents |
Syntax
$x(xpath)
Parameters
xpath
XPath expression used to match the elements to return. This follows the syntax of document.evaluate(). (required)
Examples
$x("//p")
This returns all <p>s of a page.
$x("//input[@type='checkbox']")
This returns all checkboxes of a page.
$x("//p/b[1]/text()")
This returns all text nodes within every first <b> of all <p>s of a page.