var j=document.getElementById("wb").value;
if(!!isNaN(j)||j==''){
alert('请输入1-6数字');
return false;
}
if(j>6 || j<1){
alert('请输入1-6数字');
return false;
}
var j=document.getElementById("wb").value;
if(!!isNaN(j)||j==''){
alert('请输入1-6数字');
return false;
}
if(j>6 || j<1){
alert('请输入1-6数字');
return false;
}
直接正则就好了。。
var j=document.getElementById("wb").value;
if(/^[1-6]$/.test(j))
{
alert('请输入1-6数字');
return false;
}