input 设置长度限制 去除默认样式
1.
<input id="mobile" maxlength="11>
2. input type 为 number 时,maxlength 失效
<input type="number" id="mobile" oninput="if(value.length>11)value=value.slice(0,11)">
reset 默认样式
input[type=color], input[type=date], input[type=datetime-local], input[type=datetime], input[type=email], input[type=month], input[type=number], input[type=password], input[type=search], input[type=tel], input[type=text], input[type=time], input[type=url], input[type=week], select, textarea { border: 0 none; outline:none; background: none; -webkit-appearance: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0); box-sizing: border-box; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; }
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步