var yanzheng = function() {
txt = document.getElementById("txt1").value;
if (txt.search("^-?\\d+$") != 0) {
alert("请输入一个整数!");
return false;
}
}
txt = document.getElementById("txt1").value;
if (txt.search("^-?\\d+$") != 0) {
alert("请输入一个整数!");
return false;
}
}