04 2011 档案
设置页面文本框 只能输入数字的js方法
摘要:之前写过的方法有缺陷,可以输入空格。现在将空格也屏蔽了。就是在之前的代码里加入了过滤空格的功能。代码如下:01.$("#money").bind("propertychange",function() { 02. 03. if(""!=this.value){ 04. 05. var str = this.value.replace(/(^\s*)|(\s*$)/g, ""); 06. if(this.value != str ) 07. this.value = str; 08. } 09. 10. if( is 阅读全文
posted @ 2011-04-19 12:51 The only 阅读(2204) 评论(0) 推荐(0)