$x

From FirebugWiki

Revision as of 22:51, 4 July 2012 by Sebastianz (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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

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.

See also

Personal tools