当前第2页 返回上一页
1 2 3 4 5 6 7 8 9 10 11 | app.filter( 'qxhtml' , function () {
return function (text) {
var reg = /<[^<>]+>/g;
text = text.replace(reg, '' );
text = text.replace(/ /ig, '' );
if (text.length > 50) {
text = text.substring(0, 50) + "..." ;
}
return text;
};
});
|
使用过滤器
1 2 3 | <div class = "desc" >
{{y.Description| qxhtml}}
</div>
|
更多编程相关知识,请访问:编程视频!!
以上就是js怎么替换html标签的详细内容,更多文章请关注木庄网络博客!
返回前面的内容
相关阅读 >>
javascript使用什么来标识
js || &&详解
javascript的this使用方法有哪些
javascript菜单如何实现
javascript后缀名是啥
javascript区不区分大小写
js怎么格式化日期
如何理解javascript原型链
5种javascript中解构(destructuring)的使用方法
javascript字符串大写怎么转为小写
更多相关阅读请进入《javascript》频道 >>
人民邮电出版社
本书对 Vue.js 3 技术细节的分析非常可靠,对于需要深入理解 Vue.js 3 的用户会有很大的帮助。——尤雨溪,Vue.js作者
转载请注明出处:木庄网络博客 » js怎么替换html标签