<input name=mm><input type=button value=ok onclick=cc()><script language=Javascript> //自己动手为string添加Trim
function String.prototype.Trim() {return this.replace(/(^\s*)|(\s*$)/g,"");}
function cc()
{
var e = document.all.mm;
if (e.value.Trim() == "")
{ alert("为空"); e.value="";}
else alert("不是空的");
}
</script>
function String.prototype.Trim() {return this.replace(/(^\s*)|(\s*$)/g,"");}
function cc()
{
var e = document.all.mm;
if (e.value.Trim() == "")
{ alert("为空"); e.value="";}
else alert("不是空的");
}
</script>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货