鼠标离开当前点击元素 时 进行判断

<input type='text'  id='check_numb'  onblur='do()'>

 

    function check_numb(){
         var numb=$('#check_numb').val();
            if(!(/^1(3|4|5|6|7|8|9)\d{9}$/.test(numb))){
            $('#check_id').text('手机号错误,请从新输入')
            return false
            }else{
                $('#check_id').text('')
                return true
                }

  

 函数放在$(function())外面

猜你喜欢

转载自www.cnblogs.com/jxfy/p/12397340.html