Js 删掉所有的html标签

xiaoxiao2021-02-28  105

有的时候在首页显示的时候,列表里面只需要字符串,不需要标签,那么就需要删掉html标签。

/** * 删掉所有的html标签 * @param html * @returns {XML|void|string} */ common.removeAllHtml = function (html) { return html.replace(/<[^>]+>/g, ''); };
转载请注明原文地址: https://www.6miu.com/read-34317.html

最新回复(0)