ellabeauty
ellabeauty

Reputation: 2599

How do I convert named HTML entities to numeric HTML entities in javascript?

Following this question (I have the same problem), how do I convert a string that has entities like   to a string those entities as  , with javascript/jquery ?

Upvotes: 2

Views: 387

Answers (2)

PitaJ
PitaJ

Reputation: 15022

str.replace(/$#160/g, '&nbsp');

Upvotes: 1

Related Questions