Skip to content

tedshd/javascript-htmlspecialchars

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 

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>');

About

handle view special chars in HTML

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published