|
<input id= "T1 " class= "bbox " type= "text " name= "T1 " size= "24 " autocomplete=off >
|
用jQuery给文本框添加只读属性【readOnly】
|
<input id="id" type="text" />
jQuery( $("#id").attr("readonly":"readonly"); //添加readonly属性 |
本文介绍如何使用jQuery为HTML中的文本框添加只读属性。通过简单的代码示例,展示了如何选择特定的文本框并设置其只读状态。
|
<input id= "T1 " class= "bbox " type= "text " name= "T1 " size= "24 " autocomplete=off >
|
|
<input id="id" type="text" />
jQuery( $("#id").attr("readonly":"readonly"); //添加readonly属性 |

被折叠的 条评论
为什么被折叠?