function yanzheng(val)
{
return
val.replace(/(^\s*)|(\s*$)/g, "");
}
function Inputchecking() {
var account = document.getElementById("txt_ACCOUNT");
if (yanzheng(account.value) == "")
{
alert(‘请输入账号‘);
account.focus();
return false;
}else{
return true;
}
js去除左右空格,布布扣,bubuko.com
js去除左右空格
原文:http://www.cnblogs.com/zhujingbiao/p/3732040.html