开发者社区 问答 正文

如何为属性是disabled的表单绑定js事件

一个表单,属性是disabled


我希望点击该表单后,disabled变为可编辑,用了下面的代码

全选复制放进笔记$(':input').click(function () {

$(this).removeAttr('disabled');

})

展开
收起
a123456678 2016-03-10 18:34:38 1882 分享 版权
1 条回答
写回答
取消 提交回答
  • $(document).click(function(e){
        var el = e.target;
        if (el.tagName == 'INPUT') {
            $(el).removeAttr('disabled');
        }
    })
    2019-07-17 18:58:09
    赞同 展开评论