<input type="tel" name="text1" maxlength="1" oninput="value=value.replace(/[^\d]/g,'')"> 直接上代码,测试OK。 需要的请带走