new Extra(…elementsopt)
Extra is a wrapper a la jQuery that allows to modify dom element through DOMUtils superset of the DOM API
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
elements |
Element
|
<optional> <repeatable> |
Initial selection of Elements |
Example
new Extra(document.querySelectorAll('.menu .link'))
Methods
addListeners(fun, events, bubble) → {Extra}
Adds listeners to each selected Elements.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
fun |
function
|
handler function |
events |
String
|
Array.<String>
|
|
bubble |
Boolean
|
Returns:
- Type:
-
Extra
Extra Wrapper Instance
appendChildren(…args) → {Extra}
Adds children to the FIRST selected Elements.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
args |
Element
|
<repeatable> |
Returns:
- Type:
-
Extra
Extra Wrapper Instance
getAttributes(attributes) → {Object.<string, (string|null)>}
Return an object with attributes set on the FIRST selected Element
- Source:
Parameters:
Name | Type | Description |
---|---|---|
attributes |
Array.<String>
|
Returns:
- Type:
-
Object.<string, (string|null)>
attributes set as key/values
removeAttributes(attributes) → {Extra}
Removes attributes of each selected Elements.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
attributes |
Array.<String>
|
Returns:
- Type:
-
Extra
Extra Wrapper Instance
removeClasses(classes) → {Extra}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
classes |
Array.<String>
|
Returns:
- Type:
-
Extra
Extra Wrapper Instance
removeDataAttributes(attributes) → {Extra}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
attributes |
Array.<String>
|
Returns:
- Type:
-
Extra
Extra Wrapper Instance
removeListeners(fun, events, bubble) → {Extra}
Removes listeners from each selected Elements.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
fun |
function
|
|
events |
String
|
Array.<String>
|
|
bubble |
Boolean
|
Returns:
- Type:
-
Extra
Extra Wrapper Instance
removeProperties(customProperties) → {Extra}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
customProperties |
Object.<string, (String|Number)>
|
Returns:
- Type:
-
Extra
Extra Wrapper Instance
removeStyles(styles) → {Extra}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
styles |
Object.<string, (String|Number)>
|
Returns:
- Type:
-
Extra
Extra Wrapper Instance
setAttributes(attributes) → {Extra}
Set attributes of each selected Elements.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
attributes |
Object.<string, (String|Number)>
|
Returns:
- Type:
-
Extra
Extra Wrapper Instance
setClasses(classes) → {Extra}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
classes |
Array.<String>
|
Returns:
- Type:
-
Extra
Extra Wrapper Instance
setDataAttributes(attributes) → {Extra}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
attributes |
Object.<string, (String|Number)>
|
Returns:
- Type:
-
Extra
Extra Wrapper Instance
setProperties(customProperties) → {Extra}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
customProperties |
Object.<string, (String|Number)>
|
Returns:
- Type:
-
Extra
Extra Wrapper Instance
setStyles(styles) → {Extra}
- Source:
Parameters:
Name | Type | Description |
---|---|---|
styles |
Object.<string, (String|Number)>
|
Returns:
- Type:
-
Extra
Extra Wrapper Instance
wrapNode(options, options)
Wraps selected Elements in a new Element.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
options |
||
options |
module:DOMUtils.createElementOptions
|
options object for the freshly created wrappers |