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
WBOYOriginal
2016-06-24 12:13:561306browse

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]);
}

Statement:
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
Previous article:How to use a button to select and upload local files? _html/css_WEB-ITnoseNext article:How to use a button to select and upload local files? _html/css_WEB-ITnose

Related articles

See more