Home > Web Front-end > HTML Tutorial > How to write regular rules to remove all tags using Dreamweaver_html/css_WEB-ITnose

How to write regular rules to remove all tags using Dreamweaver_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:13:56
Original
1328 people have browsed it

Just like the question


Reply to the discussion (solution)

Can anyone help?

It’s okay not to use regular expressions, just use var directly imgs = document.getElementsByTagName("img"); Then delete them one by one.

var reg = //gi;
var str = "

";
alert(str.replace(reg, ""));

var images=document.images;
var x=images.length;
for(var i=0;i var p=images[0].parentNode;
p.removeChild(images[0]);
}

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template