jquery如何让所有表单元素均为只读

来源:互联网 发布:中国河北网络电视 编辑:程序博客网 时间:2024/05/18 23:14
1、在1.6版本之前的使用
$('input,select,textarea',$('form[name="my_form"]')).attr('readonly',true);
2、如果较老的就使用:$('input,select,textarea',$('form[name="my_form"]')).prop('readonly',true);
3、$('form').find('input,textarea,select').not('这里代表需要改的元素的查找').attr('readonly',true) 或者使用 prop('readonly',true).
阅读全文
0 0
原创粉丝点击