Constructor
new Element(element, obj) → {object}
Parameters
Name | Type | Description |
---|---|---|
element |
string | The name of the tag |
obj |
object | An object with keys / values to be applied to the HTML element |
Returns
The class instance to
allow method chaining
- Type
- object
Methods
(static) get(close) → {string}
Gets the opening tag (whitout inner html),
optionally adding the self-closing token
Parameters
Name | Type | Description |
---|---|---|
close |
bool | Closes the opening tag if true, otherwise leaves it open (in this case the content and the closing tags will be added in a second time or by another function) |
Returns
Returns the HTML element as text/html
- Type
- string
(static) html(html) → {string}
Inserts a content inside the element
and returns it as text/html
Parameters
Name | Type | Description |
---|---|---|
html |
string | Inner html |
Returns
The element as text/html
- Type
- string