Apparently, this is harder to find than I thought it would be. And it even is so simple...

Is there a function equivalent to PHP's [htmlspecialchars](https://www.php.net/manual/en/function.htmlspecialchars.php) built into JavaScript? I know it's fairly easy to implement that yourself, but using a built-in function, if available, is just nicer.

For those unfamiliar with PHP, htmlspecialchars translates stuff like `<htmltag/>` into `&lt;htmltag/&gt;`

I know that `escape()` and `encodeURI()` do not work this way.