时间:2021-07-01 10:21:17 帮助过:13人阅读
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script language="javascript" type="text/javascript">
String.prototype.replaceAll = stringReplaceAll;
function stringReplaceAll(AFindText,ARepText){
var raRegExp = new RegExp(AFindText.replace(/([\(\)\[\]\{\}\^\$\+\-\*\?\.\"\'\|\/\\])/g,"\\$1"),"ig");
return this.replace(raRegExp,ARepText);
}
function myreplace(){
var content=document.getElementById("content").value;
var rel_con=content.replaceAll("$name","wwww");
document.getElementById("content2").value=rel_con;
}
</script>
</HEAD>
<BODY>
<input type="text" id="content" name="contxt" value="$name 客户姓名" /> <input type="button" value="replace"
onclick="myreplace()"/><br/>
<input type="text" id="content2" value=""/>
</BODY>
</HTML>