https://github.com/chrissy-dev/escapehtml
An extremely lightweight way to escape HTML elements with JavaScript
https://github.com/chrissy-dev/escapehtml
Last synced: 11 months ago
JSON representation
An extremely lightweight way to escape HTML elements with JavaScript
- Host: GitHub
- URL: https://github.com/chrissy-dev/escapehtml
- Owner: chrissy-dev
- Created: 2017-05-01T11:50:52.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-01T11:57:46.000Z (about 9 years ago)
- Last Synced: 2025-03-17T01:13:36.303Z (about 1 year ago)
- Language: JavaScript
- Size: 0 Bytes
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Escape HTML
> An extremely light way to set elements innerHTML as textContent.
## Usage
```HTML
```
Initialise
```javascript
// Escape all innerHTML content from elements
var rawElement = escapeHTML('code')
// Escape all innerHTML content from elements with given class
var withClass = escapeHTML('.escaped')
```