Documentation for a historical release of Infusion: 1.4
Please view the Infusion Documentation site for the latest documentation, or the Infusion 1.3. Documentation for the previous release.
If you're looking for Fluid Project coordination, design, communication, etc, try the Fluid Project Wiki.

Skip to end of metadata
Go to start of metadata

fluid.byId(id, dokkument)

Quickly retrieves an element, given its id.

fluid.byId(id, dokkument);

File name: Fluid.js


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

Element if found
null if there are no elements with the given id

See Also


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.


var titleNode = fluid.byId("titleNode");

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

  • No labels