html decode javascript
var decodeEntities = (function() {
// this prevents any overhead from creating the object each time
var element = document.createElement('div');
function decodeHTMLEntities (str) {
if(str && typeof str === 'string') {
// strip script/html tags
str = str.replace(/<script[^>]*>([\S\s]*?)<\/script>/gmi, '');
str = str.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gmi, '');
element.innerHTML = str;
str = element.textContent;
element.textContent = '';
}
return str;
}
return decodeHTMLEntities;
})();
Also in HTML:
- responsive svg image in html
- floating whatsapp button html
- zoom inkcanvas
- how to change font size in html
- center header html
- jquery replace html
- regex remove html tags
- how to make a textbox in html
- set width and height of image html
- border bottom class in bootstrap 4
- html background image fit to screen
- embed github html
- html mailto
- slick slider cdn
- TYPESCRIPT RETURN HTML ELEMENT
- javascript remove html from text
- html open things in new tab
- html align right
- how to hide error in laravel
- marquee tag in html
- html input readonly
- html theme color
- como cambiar la fuente de letra en html
- html table