drkj41932 2017-06-29 08:39
浏览 70
已采纳

如何设置输入标签以在特定表格行中启用?

I want to create dynamic table that can be set to editable and not, I'm using <input> tags because I'm submitting the data via form to php.

Here is a screen shot of the table.

enter image description here

So what I want to happen is if I click the row's edit field button the <input> tags on that row would be set to editable.

I set <input type="text" readonly>.

  • 写回答

4条回答 默认 最新

  • douao3063 2017-06-29 08:42
    关注

    You can use the .prop() function :

    $('.enableEdit').click(function(){
        $(this).closest('tr').find('input').prop('readonly', false);
        $(this).closest('tr').find('select').prop('disabled', false);
    });
    

    Where .enableEdit is the class of your edit button.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 信号傅里叶变换在matlab上遇到的小问题请求帮助
  • ¥15 保护模式-系统加载-段寄存器
  • ¥15 电脑桌面设定一个区域禁止鼠标操作
  • ¥15 求NPF226060磁芯的详细资料