有时候,我们希望表单中的文本框是只读的,让用户不能修改其中的信息,如使<input type="text" name="input1" value="中国"> 的内容,"中国"两个字不可以修改。实现的方式归纳一下,有如下几种。 方法1: onfocus=this.blur()< ...
有时候,我们希望表单中的文本框是只读的,让用户不能修改其中的信息,如使 lt input type text name input value 中国 gt 的内容, 中国 两个字不可以修改。实现的方式归纳一下,有如下几种。 方法 : onfocus this.blur lt input type text name input value 中国 onfocus this.blur gt 方法 :r ...
2018-02-28 19:53 0 2603 推荐指数:
有时候,我们希望表单中的文本框是只读的,让用户不能修改其中的信息,如使<input type="text" name="input1" value="中国"> 的内容,"中国"两个字不可以修改。实现的方式归纳一下,有如下几种。 方法1: onfocus=this.blur()< ...
方法1: onfocus=this.blur() 当鼠标放不上就离开焦点<input type="text" name="input1" value="中国" onfocus=this.blur()> 方法2:readonly <input type="text" name ...
方法1: onfocus=this.blur() <input type="text" name="input1" value="中国" onfocus=this.blur()> 方法2:readonly <input type="text" name="input1 ...
有时候,我们希望表单中的文本框是只读的,让用户不能修改其中的信息,如使<input type="text" name="input1" value="中国"> 的内容,"中国"两个字不可以修改。实现的方式归纳一下,有如下几种。 方法1: onfocus=this.blur() 当鼠标放 ...
HTML中让表单input等文本框为只读不可编辑的方法 有时候,我们希望表单中的文本框是只读的,让用户不能修改其中的信息,如使input text的内容,中国 ...
感谢原文作者:青灯夜游 原文链接:https://www.php.cn/div-tutorial-413133.html 目录 问题 实现方式 1、οnfοcus=this.blur() 2、readonly属性 ...
两种方法: $("#id").attr("readOnly",false); 不可编辑,可以传值 $("#id").attr("disabled",false);不可编辑,不可以传值 注意readOnly 中的O是大写 ...