Article provides 14 JS filter HTML tag Code Oh, they use a variety of methods to filter the HTML tag code, these codes are very good oh, well, let's see. <!doctype HTML Public "-//W3C//DTD XHTML 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/ Xhtml1-transitional.dtd "" <html xmlns= "http://www.jzread.com/1999/xhtml" <head> < Meta http-equiv= "Content-type" content= "HTML; charset=gb2312 "/> <title>js Filter HTML tags </title> <script language=" web Effects " function Covertfromxmltag (value) { value = Value.split ("&"). Join ("&"); value = Value.split ("<"). Join ("<"); value = Value.split (">"). Join (">"); value = Value.split (' "). Join (" " "); value = Value.split (""). Join (" "); value = Value.split ("R"). Join (""); value = Value.split ("n"). Join ("<br/>"); return value; }
function escapehtml (value) { With (Document.createelement ("div")) { AppendChild (document.createTextNode (value)); return Innerhtml.replace (/"G, ""); } }
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.