一个表单,属性是disabled<input type="text" disabled/>我希望点击该表单后,disabled变为可编辑,用了下面的代码$(':input').click(function () { $(this).removeAttr('disabled');})可是发现怎么点击都不行,求指导。测试地址 http://jsfiddle.net/6cm9r/
2 回答
收到一只叮咚
TA贡献1821条经验 获得超5个赞
$(document).click(function(e){
var el = e.target;
if (el.tagName == 'INPUT') {
$(el).removeAttr('disabled');
}
})
添加回答
举报
0/150
提交
取消
