Home > Web Front-end > JS Tutorial > body text

Example of jquery prohibiting the input of characters other than numbers (pure numeric verification code)_jquery

WBOY
Release: 2016-05-16 16:52:53
Original
1254 people have browsed it

Used when using purely numerical verification codes, they are organized as follows:

Copy code The code is as follows:

$('#mobile-vcode').unbind( );
$("#mobile-vcode").bind("keyup change",function () {
$(this).val($(this).val().replace(/D/ g,''));
if($(this).val().length==4){
/*ajax checks whether the verification code is correct, and activates the button if it is correct*/
}
});
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template