Home >Web Front-end >JS Tutorial >Use js to determine whether the input is Chinese function_javascript skills

Use js to determine whether the input is Chinese function_javascript skills

WBOY
WBOYOriginal
2016-05-16 16:56:061019browse
The example is as follows:
Copy code The code is as follows:

function ischinese( s){
var ret=true;
for(var i=0;iret=ret && (s.charCodeAt(i)>=10000);
return ret;
}
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