【JQuery】给文本框添加只读属性【readOnly】

代码如下:

$(“#id”).attr(“readonly”:”readonly”);   

//添加readonly属性 & $(“#ID”).attr({ readonly: ‘true’ });

 $(“#id”).removeAttr(“readonly”);   

//去除readonly属性

Author: jhonse

Jhonse技术博客: http://blog.jhonse.com

Leave a Reply

Your email address will not be published. Required fields are marked *