Constructor
new (require("MHTMLDataElement"))(id, remove)
- Description:
Constructor.
Parameters:
| Name | Type | Description |
|---|---|---|
id |
string | ID of the HTML element that will be operated on. |
remove |
boolean | Remove the element from the dom. |
Methods
isValid() → {boolean}
- Description:
Whether HTML element found and ready to operate on.
Returns:
Result.
- Type
- boolean
getDataAttributeValue(attributeName, defaultValue) → {string}
- Description:
Get data attribute value for given
attributeName.data-should not be provided inattributeNameas it will be added by the method.
Parameters:
| Name | Type | Description |
|---|---|---|
attributeName |
string | Attribute name without |
defaultValue |
* | Default value to be returned if the value of the given |
Returns:
Value.
- Type
- string
getDataAttributeValueAsBoolean(attributeName) → {boolean}
- Description:
Get data attribute value as boolean for given
attributeName.data-should not be provided inattributeNameas it will be added by the method.
Parameters:
| Name | Type | Description |
|---|---|---|
attributeName |
string | Attribute name without |
Returns:
Value.
- Type
- boolean
getDataAttributeValueAsJSON(attributeName, defaultValue) → {null|JSON}
- Description:
Get data attribute as JSON object for given
attributeName.data-should not be provided inattributeNameas it will be added by the method.
Parameters:
| Name | Type | Description |
|---|---|---|
attributeName |
string | Attribute name without |
defaultValue |
* | Default value to be returned if the value of the given |
Returns:
Value.
- Type
- null | JSON