Constructor
new ElementRef(el)
Creates an instance of ElementRef capsule around the given element (object).
Parameters:
Name | Type | Description |
---|---|---|
el |
Object | the element to wrap |
- Since:
- 0.1.0
- Source:
Example
var divElement = document.getElementById(...); // or document.createElement('div')
var labelElement = document.getElementById(...); // or document.createElement('label')
var divCapsule = new capsula.ElementRef(divElement);
var labelCapsule = new capsula.ElementRef(labelElement);
divCapsule.hook.tie(labelCapsule.loop); // this is where the divElement becomes the parent of the labelElement
Members
Collection of Hooks
Properties:
Name | Type | Description |
---|---|---|
hook |
module:capsula.Hook | A hook that represents the wrapped element (object). |
- Since:
- 0.1.0
- Source:
Collection of Loops
Properties:
Name | Type | Description |
---|---|---|
loop |
module:capsula.Loop | A loop that represents the wrapped object (element). |
- Since:
- 0.1.0
- Source:
Methods
getElement() → {Object}
Returns the wrapped object (element).
- Since:
- 0.1.0
- Source:
Returns:
the wrapped object (element)
- Type
- Object