Javascript убрать теги HTML из текста
Code (javascript)
-
-
function removeHTMLTags(text) {
-
strInputCode = text.replace(/&(lt|gt);/g, function (strMatch, p1){
-
return (p1 == "lt")? "<" : ">";
-
});
-
var strTagStrippedText = strInputCode.replace(/<\/?[^>]+(>|$)/g, "");
-
return strTagStrippedText;
-
}
-

(3 голосов, в среднем: 4.67 из 5)