Home>Article>Web Front-end> jquery realizes that the specified text box can only enter numbers

jquery realizes that the specified text box can only enter numbers

php中世界最好的语言
php中世界最好的语言 Original
2018-04-26 13:48:43 2166browse

This time I will bring you jquery to realize that only numbers can be entered into the specified text box. jquery can only input numbers into the specified text box.What are the precautions?The following is a practical case, let's take a look.

First, let’s start with a jQuery code that stipulates that the text box can only enter numbers including decimals:

    PHP   
    

2. How jQuery stipulates that the text box can only enter integers:
Sometimes the content of the text box can only be numbers, and it can only be integers. For example, for age, you cannot fill in 20.8 years old. The following is an example of how to implement this function through code. I hope it can help those who need it. Friends bring help, the code is as follows:

   1   
    
I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the PHP Chinese website!

Recommended reading:

Jquery Mobile custom button icon steps detailed explanation

Set multi-line text box [textarea] automatically Generate height

The above is the detailed content of jquery realizes that the specified text box can only enter numbers. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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