Element
Element is basically a constructor that will take anything (string, node...) and returns the appropriate Elementify object.
If the provided input cannot be elementified, it is returned unchanged
Constructor Summary
Public Constructor | ||
public |
constructor(input: String | Node | HTMLElement, options: keyValueObject): HtmlElement | FormElement | FormInput | FormSelector | FormSwitcher | Collection |
version 1.0.0 since 1.0.0 |
Method Summary
Private Methods | ||
private |
_nodeToElement(node: Node, options: KeyValueObject): HtmlElement | FormElement | FormInput | FormSelector | FormSwitcher | Collection Converts a node to an HtmlElement. |
version 1.0.0 since 1.0.0 |
private |
_stringToElements(s: String, options: KeyValueObject): HtmlElement | FormElement | FormInput | FormSelector | FormSwitcher | Collection Converts a string to an HtmlElement. |
version 1.0.0 since 1.0.0 |
Public Constructors
public constructor(input: String | Node | HTMLElement, options: keyValueObject): HtmlElement | FormElement | FormInput | FormSelector | FormSwitcher | Collection version 1.0.0 since 1.0.0 source
Private Methods
private _nodeToElement(node: Node, options: KeyValueObject): HtmlElement | FormElement | FormInput | FormSelector | FormSwitcher | Collection version 1.0.0 since 1.0.0 source
Converts a node to an HtmlElement. You don't usually need to call directly this method.
Params:
Name | Type | Attribute | Description |
node | Node | Node to import |
|
options | KeyValueObject |
|
An option/value object that will be passed to the resulting object. It may contain any HTML attributes and options. See each returned elements for legible values. |
private _stringToElements(s: String, options: KeyValueObject): HtmlElement | FormElement | FormInput | FormSelector | FormSwitcher | Collection version 1.0.0 since 1.0.0 source
Converts a string to an HtmlElement. You don't usually need to call directly this method.
Params:
Name | Type | Attribute | Description |
s | String | String value to be converted to an Element |
|
options | KeyValueObject |
|
An option/value object that will be passed to the resulting object. It may contain any HTML attributes and options. See each returned elements for legible values. |