JS Regular Expression inserts data code at the specified location
<! 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 the regular expression inserts data code at the specified location </title>
</head>
<body>
<script type= text/javascript Tutorial
//<![ cdata[
var g= ' <b><span class= "AAA" style= "..." ></span></b>--> <b><span Class= "AAA" style= ... ">123</span></b>";
Function Fillinner (html,val) {
return html.tostring (). Replace (/(< (d+) [^>]*>) ([^ <]*) (</2>) G, ' $ +val+ ')
};
Alert (Fillinner (g, ' Google '));
//]]
</script><script type= "Text/javascript"
//<![ cdata[
var g= ' <b><span></span></b>--> <b><span>123</span></b > ';
Function Fillinner (html,val) {
return html.tostring (). Replace (/(< (d+) >) ([^<]*) ( </2>) G, ' +val+ ' $ ')
};
Alert (Fillinner (g, ' Google '));
//]]
</script>
</body>
</html>