function DeleteHtmlFromStartToEnd(str, begin, end) {
str = str.replace(begin + end, "");
if (str.indexOf(begin) == -1) {//沒找到
return str;
}
var substr = str.substring(str.indexOf(begin) + begin.length, str.indexOf(end));
str = str.replace(substr, "");
return DeleteHtmlFromStartToEnd(str, begin, end);
}
var str = '00000<!--deleteBegin-->1234567<!--deleteEnd-->111111<!--deleteBegin-->890<!--deleteEnd-->22222<!--deleteBegin-->890<!--deleteEnd--><!--deleteBegin-->890<!--deleteEnd-->3';
var result = DeleteHtmlFromStartToEnd(str, '<!--deleteBegin-->', '<!--deleteEnd-->');
alert(result);