This documentation is currently being moved to our new documentation site.

Please view or edit the documentation there, instead.

If you're looking for Fluid Project coordination, design, communication, etc, try the Fluid Project Wiki.

fluid.byId

fluid.byId(id, dokkument)

Quickly retrieves an element, given its id.

fluid.byId(id, dokkument);

File name: Fluid.js

Parameters

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


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

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

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