Javascript 如何隐藏标题和列?

Javascript 如何隐藏标题和列?,javascript,jquery,css,Javascript,Jquery,Css,我需要使用jQuery隐藏标题和列。下面的代码不起作用 $('#MD116139889_ZIPCODE_InputField').find('.input-group-addon').click(function(){ $('.116141670_ZIPCODE_IDPopupHead').hide(); $('.116141670_ZIPCODE_IDPopupCol').hide(); }); 齐皮德 邮政编码 为了一个简单的测试用例,我去掉了绑定的find(),但它似

我需要使用jQuery隐藏标题和列。下面的代码不起作用

$('#MD116139889_ZIPCODE_InputField').find('.input-group-addon').click(function(){
    $('.116141670_ZIPCODE_IDPopupHead').hide();
    $('.116141670_ZIPCODE_IDPopupCol').hide();
});


齐皮德
邮政编码
为了一个简单的测试用例,我去掉了绑定的find(),但它似乎工作得很好

$('MD116139889_ZIPCODE_InputField')。单击(函数(){
$('.116141670_ZIPCODE_IDPopupHead').hide();
$('.116141670_ZIPCODE_IDPopupCol').hide();
});

齐皮德
邮政编码

单击我
,首先确保页面上存在这些元素。您可以
console.log($('aselector').length),在控制台中查看是否找到任何内容。没有提供标记供我们查看,只剩下调试建议。请显示相关的HTML。@Taplar it show 1这是什么意思?这意味着它找到了元素,hide()将在其上放置css样式的display:none属性。我尝试了display:none,但不起作用@TaplarI尝试删除find(),但不隐藏两个类。我调试它,代码运行但不隐藏。我并不是说您不需要find()来定位您正在单击的元素,这些元素应该会导致逻辑发生。我只是演示运行该方法以这两个类为目标并隐藏它们将导致列被隐藏。至少在Firefox上对我来说,我知道你不会这么说。我试着这样做,两个代码都是一样的。我的工作包没有按钮,它是弹出的。
<div id="MD116139889_ZIPCODE_dialog" class="ui-dialog-content ui-widget-content" style="width: auto; min-height: 76px; max-height: none;">
<div id="popUpContentResult" class="table-responsive">
<table class="table table-hover">
<thead>
<tr>
<th width="30%" height="19" class="text-center 116141670_ZIPCODE_IDPopupHead">ZipId</th>
<th class="text-center 116141670_ZIPCODEPopupHead">Zip Code</th>
</tr>
</thead>
<tbody>
<tr>
<td align="center" class="text-center 116141670_ZIPCODE_IDPopupCol"><a href="Javascript:selectitem0();">00196</a></td>
</tr>
</tbody>