handle view special chars in HTML
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
javascript-htmlspecialchars.js

README.md

javascript-htmlspecialchars

Description

handle view special chars or HTML ASCII in HTML

if string &#lt; show in HTML <

use javascript-htmlspecialchars

string &#lt; output in HTML &#lt;

Usage

in javascript

var str = '&lt;';
str = util.htmlspecialchars(str);

document.getElementById('area_1').innerHTML= 'innerHTML-' + str;

// jQuery
$('#area_2').html('html-' + str);
$('#area_3').append('append-' + '<span>' + str + '</span>');