Converts the HTML entities &, <, >, ", " and ' in a string to their corresponding characters.
Returns: String - The unescaped string.
Throws:
TypeErrorIfsubjectStringis not string.
| Param | Type | Description |
|---|---|---|
| subjectString | String |
The HTML string to unescape. |
Example
unescapeHTML('<script src="main.js"></script>');
// => '<script src="main.js"></script>'
unescapeHTML('Hello & <span>World</span>');
// => 'Hello & <span>World</span>'
unescapeHTML('<p data-id="1">lorem ipsum</p>');
// => '<p data-id="1">lorem ipsum</p>'