w200221626通过本文主要向大家介绍了js去掉html中的注释等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
js函数去掉html中的注释
//去掉html中的注释
function filterNotes(str) {
var tmp = str.substring(str.indexOf("<!--"), str.lastIndexOf("-->") + 3);
return str.replace(tmp, "");
}