标签:
1 function num (event,obj) { 2 $(document).on(event,obj,function(event){ 3 event.stopPropagation(); 4 var _this = $(this); 5 var reg = /^\d+(\.\d+)?$/; 6 var num = parseFloat( _this.val() ); 7 var result = reg.test(num); 8 if(!result){ 9 _this.val(‘‘); 10 } 11 }) 12 } 13 14 num(‘blur‘ , ‘#is2‘);
标签:
原文地址:http://www.cnblogs.com/web-alibaba/p/4535283.html