javascript:
替换成\n

<html>
<body>
<script type="text/javascript">
var msg="test1"+"\<br/>"+"test2"+"\<br/>";; 
document.write(msg);
var msg2=msg.replace(/<br\s*\/>/gi, "\n");
document.write(msg2);
</script>
</body>
</html>

 

你可能感兴趣的:(javascript:
替换成\n)