JS verify listens for incoming bank card number

$ ( "# AccountNum"). KeyDown ( function (E) {
     IF (! IsNaN ( the this .value.replace (/ [] / G, "" ))) {
         the this .Value = the this .value.replace (/ \ . S / G, '') Replace (/ (\. 4 {D}) (? = \ D) / G, "$. 1"); // four digits group, separated by spaces 
    } the else {
         IF (E. ==. 8 the keyCode) { // when illegal character input, in addition to prohibiting backspace key input 
            return  to true ;
        }else{
            return false
        }
    }
});

 

Guess you like

Origin www.cnblogs.com/init-007/p/11669594.html