//自动判断输入的书否为正整数 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) }); }
时间: 2024-10-08 05:28:39