bloody-escapehtml
v1.1.0
Published
escape HTML special chars
Downloads
4
Readme
escapeHTML
install
$ npm install bloody-escapehtml
require
var escapeHTML = require("bloody-escapehtml")
api
escapeHTML(string) > escapedString
escapes special HTML chars :
& => &
< => <
> => >
" => "
' => '
escapeHTML.unescapeHTML(string) > string
unescapes special HTML chars.
example
var safeValue = escapeHTML(input.value)
// -> "<div></div>"