How to remove <img> tag OR any tag in html

99 阅读1分钟

we can use regular expression

let reg_for_img = /<\/?img[^>]*?>/igm;
let reg_for_div = /<\/?div[^>]*?>/igm;
//if need to remove another tags just replace