- <html>
- <head>
- <metahttp-equiv="Content-Type"content="text/html"/>
- <title>只能输入汉字js脚本</title>
- </head>
- <body>
- 只能输入汉字:<INPUTonkeyup="value=value.replace(/[^\u4E00-\u9FA5]/g,'')">
- <script>
- functionischinese(s){
- varret=true;
- for(vari=0;i<s.length;i++)
- retret=ret&&(s.charCodeAt(i)>=10000);
- returnret;
- }
- </script>
- </body>
- </html>
只能输入汉字js脚本
最新推荐文章于 2019-02-14 14:40:58 发布