js里面是没有Trim()这个方法的可以用以下的形式来判断是否输入的值为空

 if (text.value.replace(/\s+/g, "").length == 0)

posted on 2014-05-06 15:02  drafire  阅读(359)  评论(0编辑  收藏  举报