Only numbers (integers and decimals) can be entered in the jquery text box.

Source: Internet
Author: User

Only numbers (integers and decimals) can be entered in the jquery text box.

This article introduces the detailed code that allows you to enter only numbers in the jquery limited text box. The details are as follows:

First, you can enter only numbers including Decimals in the specified text box:

<! DOCTYPE html> 

2. How does jQuery specify that only integers can be entered in the text box:
Sometimes the content of a text box can only be a number and can only be an integer, such as age. You cannot enter 20.8 years old. The following code example shows how to implement this function, the Code is as follows:

<Html> 

The above Code meets our requirements. Only integers can be entered in the text box.

I hope this article will help you learn jquery programming.

Articles you may be interested in:
  • Jquery-based setting page text box can only enter the implementation code of numbers
  • Jquery-limited text box can only enter numbers, that is, integers and Decimals
  • In the jquery tutorial, only numbers and decimal point examples can be entered in the restricted text box.
  • Three Jquery methods to restrict text boxes from entering only numbers and letters

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.