Unescape HTML

Decode HTML entities back to their original characters.

Code

Utilities
str.replace(/&(amp|lt|gt|quot|#39);/g, (_, e) => ({ amp: '&', lt: '<', gt: '>', quot: '"', '#39': "'" }[e]));

Parameters

HTML-encoded string.

Browser·fetch() may be limited by CORS

More JavaScript Snippets