input设置只读;input设置不可编辑

时间:2024-10-14 03:38:59

1、新建一个html页面,在这个html页面创建一个input文本输入框。

input设置只读;input设置不可编辑

2、添加只读属性。在input标签里添加readonly="readonly" ,就可以把这个文本输入修改为不可编辑了。

input设置只读;input设置不可编辑

3、保存html页面后使用浏览器打开,鼠标放到对应input文本框上,发现该文本框无法获取焦点,表示设置只读属性成功。

input设置只读;input设置不可编辑
© 手抄报圈