js字符串完全替换函数分享_javascript技巧:这几天用到了js字符串完全替换的功能,啥都不说,直接上代码,需要拷走即可: 代码如下: function testStr(){ var temp=document.getElementById(content).value; var newContent=temp.replace(//g,'\'')
导读js字符串完全替换函数分享_javascript技巧:这几天用到了js字符串完全替换的功能,啥都不说,直接上代码,需要拷走即可: 代码如下: function testStr(){ var temp=document.getElementById(content).value; var newContent=temp.replace(//g,'\'')
这几天用到了js字符串完全替换的功能,啥都不说,直接上代码,需要拷走即可:
代码如下:
function testStr(){
var temp=document.getElementById("content").value;
var newContent=temp.replace(/"/g,'\'');
alert(newContent);
}
script>
js字符串完全替换函数分享_javascript技巧:这几天用到了js字符串完全替换的功能,啥都不说,直接上代码,需要拷走即可: 代码如下: function testStr(){ var temp=document.getElementById(content).value; var newContent=temp.replace(//g,'\'')