正则表达式(判断是否为数字)

来源:互联网 发布:idc数据机房 编辑:程序博客网 时间:2024/05/17 15:02
function jump_to(){
var index = document.getElementById("inputPage").value;
if(!/^[0-9]+$/.test(index)){
alert("输入有误,请输入数字!");
}else{
window.location="newsDetailList.jsp?currentPage="+index;
}
}
0 0