Home > Web Front-end > JS Tutorial > Example of Javascript prohibiting input of Chinese or English_javascript skills

Example of Javascript prohibiting input of Chinese or English_javascript skills

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 16:28:04
Original
2094 people have browsed it

This tutorial teaches you how to use Javascript to limit the input of English or limit the input of Chinese.

English input is prohibited:

Copy code The code is as follows:


Use regular expressions to limit input to Chinese only:

Copy code The code is as follows:


1. Use regular expressions to limit the input of only full-width characters:

Copy code The code is as follows:


2. Use regular expressions to limit input to numbers:

Copy code The code is as follows:


3. Use regular expressions to limit input to numbers and English only:

Copy code The code is as follows:



Related labels:
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
Latest Issues
What are JavaScript hook functions?
From 1970-01-01 08:00:00
0
0
0
What is JavaScript garbage collection?
From 1970-01-01 08:00:00
0
0
0
c++ calls javascript
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template