javascript - 如何选择串联名称

标签 javascript jquery jquery-plugins

如何在 jquery 中选择串联名称,这是我的示例代码;

p = "WL_INVDTL.0001.LW3SUPRC";

$('input[name=p]').attr("disabled",false);

是否可以选择串联文本。

最佳答案

使用

$('input[name="' + p '"]').prop("disabled",false);

更新:

$(document).ready(function() {
    $('#WL_INVDTL').on('click', 'tr td:first-child input:checkbox', function(){
        var $this = $(this);
        $this.closest('tr').find('input:text').prop('disabled', !$this.is(':checked'))
    })
});

演示:Fiddle

关于javascript - 如何选择串联名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16331617/

相关文章:

asp.net - 如何让javascript在更新面板中执行

javascript - 如何在 jQuery 单击事件中显示不透明背景

javascript - javascript 中 [].slice.call 的解释?

javascript - 在 TinyMCE 初始化后使用 javascript 设置 textarea 值

javascript - 如何慢慢改变bootstrap div的内容

javascript - jquery 中复选框未选中时如何清除文本框值?

jquery - 如何通过 jQuery 更新 cookie 的过期日期?

javascript - babel 转译代码使用绝对导入

javascript - Jquery datepicker 输入普通文本和日期

javascript - safari 中的 jquery 插件错误