如何利用html5
语法禁止input
文本输入,或者控制文字输入?下面web建站小编给大家详细介绍一下具体实现代码!
1、input禁止文本输入
//readonly <input type="text" value="" readonly="readonly"> //disabled <input type="text" value="" disabled="disabled"> //maxlength <input type="text" value="" maxlength="0"> //onfocus <input type="text" value="" onfocus="this.blur();">
2、input只允许输入数字
<input class="inputs" type="number" placeholder="请输入11位数字" oninput="if(value.length>11)value=value.slice(0,11)" /> <input type="text" placeholder="请输入您的手机号" oninput = "value=value.replace(/[^\d]/g,'')" maxlength="11">
3、input只允许输入中文
<input onkeyup="value=value.replace(/[^\u4E00-\u9FA5]/g,'')" onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^\u4E00-\u9FA5]/g,''))">
html5从youtube分享处理的播放拦截播放失败怎么解决
上面是“html5如何input禁止文本输入(控制输入)”的全面内容,想了解更多关于 前端知识 内容,请继续关注web建站教程。
当前网址:https://ipkd.cn/webs_3495.html
workflows工作流
一只蚂蚁在花丛中找食物ComfyUI工作流
汉堡里的一只毛茸茸的小猫ComfyUI工作流
骨骼般的恶魔修女ComfyUI工作流
一辆在泥潭中奔跑的布加迪ComfyUI工作流
坐落在白雪覆盖的广阔平原上2只可爱的雪豹
Latent放大comfyui工作流
一张精心制作的熊岛复古地图ComfyUI工作流
在地铁站里一个迷茫的非主流姑娘
猜你喜欢
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!