只能输入汉字js脚本
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html" />
- <title>只能输入汉字js脚本</title>
- </head>
- <body>
- 只能输入汉字:<INPUT onkeyup="value=value.replace(/[^\u4E00-\u9FA5]/g,'')">
- <script>
- function ischinese(s){
- var ret=true;
- for(var i=0;i<s.length;i++)
- retret=ret && (s.charCodeAt(i)>=10000);
- return ret;
- }
- </script>
- </body>
- </html>
积跬步以致千里,积小流以成江海。
2016年5月之前的博文发布于51cto,链接地址:shamrock.blog.51cto.com
2016年5月之后博文发布与cnblogs上。
Github地址 https://github.com/umgsai
Keep moving~!!!
2016年5月之前的博文发布于51cto,链接地址:shamrock.blog.51cto.com
2016年5月之后博文发布与cnblogs上。
Github地址 https://github.com/umgsai
Keep moving~!!!