$

From FirebugWiki

(Difference between revisions)
Jump to: navigation, search
(Added hint that page's command won't be overwritten)
m (More detailed description of the command not being overwritten)
Line 1: Line 1:
This command returns a single HTML or XML element with the given id. This means it is actually a shortcut for <code>document.getElementById()</code>.
This command returns a single HTML or XML element with the given id. This means it is actually a shortcut for <code>document.getElementById()</code>.
-
If the page already defines <code>$</code> for something else, it will not be overwritten by this command.
+
If the JavaScript on the page already defines <code>$</code> for something else (like e.g. jQuery does), it will not be overwritten by this command.
== Parameters ==
== Parameters ==

Revision as of 21:47, 4 July 2012

This command returns a single HTML or XML element with the given id. This means it is actually a shortcut for document.getElementById().

If the JavaScript on the page already defines $ for something else (like e.g. jQuery does), it will not be overwritten by this command.

Parameters

id

Id of the element to return. (required)

Examples

$("element")

This returns the element with the id element.

Personal tools