js正则匹配

var account = $('input[name="account"').val();
var re = /^[0-9]+.?[0-9]*$/;
if (!re.test(account)) {
$('#alert_bd').text('账号为数字!');
     $('#my-alert').modal();
     $('input[name="account"').val('');
     return;
}

  

posted @ 2016-08-15 10:14  东歌  阅读(136)  评论(0编辑  收藏  举报