13 10 2010

input[type=number]

bigCat Posted in JavaScript - Comment.isBlank

不支持.只好...\r\n

 var jq = jQuery.noConflict(); //把$让给第一个实现它的库,用jq代替\r\n    jq(function() {\r\n        var input = jQuery('input');\r\n        function isPass() {\r\n            var result = input.val().match(/\d+/);\r\n            result==null?input.val(''):input.val(result);\r\n        }\r\n        input.keyup(function(){isPass();}).blur(function() {isPass();})\r\n    });\r\n

Host: (miao) | Word: Press | Code: HTML5