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

WBOY
Release: 2016-05-16 16:28:04
Original
2062 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:
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