fluid.byId(id, dokkument) Section |
---|
Column |
---|
| Quickly retrieves an element, given its id. Code Block |
---|
| javascript |
---|
| javascript |
---|
bgColor | white |
---|
borderStyle | nonejavascript |
---|
|
fluid.byId(id, dokkument);
|
File name: Fluid.js Parameters Span (Deprecated) |
---|
| 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) |
---|
| Element | if found | null
| if there are no elements with the given id |
|
|
| NotesThis 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 |
---|
|
var titleNode = fluid.byId("titleNode");
|
In this example, fluid.byId() will return the node found with an id attribute equal to "titleNode." |