限制为整数 <html> <head> [removed] var G=document.getElementById; function checkNumber(){ var reg = /^(?:0|[1-9][0-9]?|100)$/; var strNumber = G(txtNumber).value; alert(reg.test(strNumber)) } [removed] </head> <body > <input type=text value= id=