整数

if (!/^[0-9]+$/.test($.trim($('#addViewerSum').val()))) {
                        alert('浏览次数格式为整数,请重新输入!');
                        $('#addViewerSum').focus();
                    }

原文地址:https://www.cnblogs.com/whlhaikuotiankong/p/3401961.html