Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Div
classapi-page

fluid.byId(id, dokkument)

Section
Column
width70%

Quickly retrieves an element, given its id.

Code Block
javascript
javascript
bgColorwhite
borderStylenonejavascript
fluid.byId(id, dokkument);

File name: Fluid.js

Parameters

Span (Deprecated)
classborderless-table

id

(Object) The id of the DOM node to find

dokkument

(Document) (optional) The document in which it is to be found (if left empty, use the current document)

Return Value

Span (Deprecated)
classborderless-table

Element

if found

null

if there are no elements with the given id

Column
width5%

Column

See Also


Notes

This function works around a problem with calls to document.getElementById() where sometimes, nodes with a name matching the id will be returned. This function will throw an error with a descriptive message if that happens.

Example

Code Block
javascript
javascript
var titleNode = fluid.byId("titleNode");

In this example, fluid.byId() will return the node found with an id attribute equal to "titleNode."