验证数字并补位
function verPCBValue(dom) { let value = dom.val(); let num = isNaN(parseInt(value)) ? 0 : parseInt(value); if (num > 255) num = 255; if (num < 0) num = 0; dom.val(padleft(2, num)); } function padleft(len, data) { while (data.toString().length < len) { data = '0' + data; } return data; }