通过属性如何设置文本框为只读

2024-10-20 10:45:14

1、文本框标签格式<input type="text" />;

通过属性如何设置文本框为只读

3、最终方式:<input type="text" readonly="readonly"/>;

通过属性如何设置文本框为只读

5、document.getElementById("username").readOnly租涫疼迟="readonly";只读document.getElementById("username").readOnly="";可读

通过属性如何设置文本框为只读

7、当然你在页面如果引入了js文件,那么$("#username").readOnly="readonly";也是可以实现相同的效果的,上面只是贴出了主要的部分代码,有兴趣的可以试试,谢谢支持

通过属性如何设置文本框为只读
猜你喜欢