标签:
//自动判断输入的书否为正整数 function wds_purchase_keyup(t) { var val = $(t).val(); if (!/^[0-9]+$/.test(val) && val != "") { var prev = $(t).attr("num"); $(t).val(prev); return; } $(t).attr({ "num": val, value: val == "" ? "" : parseInt(val) }); }
标签:
原文地址:http://www.cnblogs.com/xiaoyaodijun/p/4475548.html