//Regular Express to filter the character ,return bool function ValidNumber(inpString) { return /^[-+]?\d+(\d+)?$/.test(inpString); } //return the cursor to where judge $('#id').focus();