当前位置:网站首页>input禁止输入
input禁止输入
2022-08-02 00:17:00 【m0_67403240】
input标签禁止输入的方法:
- 添加 οnfοcus=“this.blur()” 使元素失去焦点
- 将属性 maxlength 的值设为 0
例如:<input type=“number” name=“” id=“” max=“10” min=“1” οnfοcus=“this.blur()”>
例如:
input标签禁用的方法:
- 添加 disabled 禁用属性
- 添加 readonly 只读属性
注意:“禁用” 和 “禁止输入” 是有区别的,禁用会使input自带的功能丧失,标签呈灰色状态。而禁止输入仍能保持原有功能
注意:下方是源代码,可直接复制
<input type=“password” name=“” id=""maxlength=“6”>
yes
no
one
two
three
button
<input type=“number” name=“” id=“” max=“10” min=“1” οnfοcus=“this.blur()”>
one two three
先自我介绍一下,小编13年上师交大毕业,曾经在小公司待过,去过华为OPPO等大厂,18年进入阿里,直到现在。深知大多数初中级java工程师,想要升技能,往往是需要自己摸索成长或是报班学习,但对于培训机构动则近万元的学费,着实压力不小。自己不成体系的自学效率很低又漫长,而且容易碰到天花板技术停止不前。因此我收集了一份《java开发全套学习资料》送给大家,初衷也很简单,就是希望帮助到想自学又不知道该从何学起的朋友,同时减轻大家的负担。添加下方名片,即可获取全套学习资料哦
边栏推荐
- String splitting function strtok exercise
- 辨析内存函数memset、memcmp、memmove以及memcpy
- uni-app项目总结
- Looking back at 5 recessionary times in history: How might this time be different?
- els block boundary deformation processing
- go笔记记录——channel
- 06-SDRAM : SDRAM control module
- 146. LRU cache
- How to find new potential projects?Tools recommended
- 管理基础知识18
猜你喜欢
随机推荐
Don't know about SynchronousQueue?So ArrayBlockingQueue and LinkedBlockingQueue don't and don't know?
严格模式,use strict
测试点等同于测试用例吗
21.数据增强
uni-app project summary
C语言实现扫雷游戏
2022/08/01 学习笔记 (day21) 泛型和枚举
els block boundary deformation processing
基于数据驱动的变电站巡检机器人自抗扰控制
23.卷积神经网络实战-ResNet
MySQL常用语句整理
思维导图,UML在线画图工具
ERROR 2003 (HY000) Can‘t connect to MySQL server on ‘localhost3306‘ (10061)
PHP to read data from TXT file
A simple file transfer tools
unity2D横版游戏教程5-UI
JSP out. The write () method has what function?
渗透测试与攻防对抗——渗透测试基础
冒泡排序函数封装
String splitting function strtok exercise