删除JavaScript与文本返回的标签 [英] remove tags which javascript returns with the text

查看:76
本文介绍了删除JavaScript与文本返回的标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这里是我的函数

here's my function

    function getInfo(Description) {


        return Description;    


}

这里说明

<p>Info Summary:<span>2.26PM</span> InfoADDED</p>

现在,我想在返回'Description'之前消除
pls。帮助

now, i want to eliminate html tags before returning the 'Description' pls. help

推荐答案

这是我的工作原理

this is what has worked for me

return Description.replace(/&nbsp;/gi, " ").replace(/(<([^>]+)>)/ig, "");

上面的CMS前也是很好的
,但这是最适合我的

above CMS ex is also good but this is what fitted best for me

这篇关于删除JavaScript与文本返回的标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆