1.将换行符转换成空格: var content = accountInfo.replace(/\r\n/mg,' ');
2.将空格转换成换行:var accountInfo = (document.getElementById("accountInfo").value).replace(/\ /g,'<br>');
1.将换行符转换成空格: var content = accountInfo.replace(/\r\n/mg,' ');
2.将空格转换成换行:var accountInfo = (document.getElementById("accountInfo").value).replace(/\ /g,'<br>');