Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 隐藏带有关联属性的输入标记_C#_Jquery_Asp.net - Fatal编程技术网

C# 隐藏带有关联属性的输入标记

C# 隐藏带有关联属性的输入标记,c#,jquery,asp.net,C#,Jquery,Asp.net,我想用属性keep current customization=“false”隐藏输入类型标记。我的代码是: var example = jQuery.noConflict(); example(function () { example.attr("input[keep-current-customization='false']").hide(); }); 但它不起作用 以下是源代码在页面上的外观: <h3>Current Carrier Questionnaire

我想用属性keep current customization=“false”隐藏输入类型标记。我的代码是:

var example = jQuery.noConflict();
example(function () {
    example.attr("input[keep-current-customization='false']").hide();
});
但它不起作用

以下是源代码在页面上的外观:

  <h3>Current Carrier Questionnaire<strong style="color: Red;"></strong></h3>

  <div class="desc">
      To keep your current home phone number,  please complete the below.</div>
  <br />

  <div class="textgrid">
       <div class="feildset1">
            Account holders name on your current phone bill?: </br>
            <input name="rptCustomization$ctl07$rptItems$ctl00$ctrl" type="text" maxlength="100" id="rptCustomization_rptItems_7_ctrl_0" keep-current-customization="false" /></br>
           <br />
       </div>
   </div>

   <div class="textgrid">
        <div class="feildset1">
             Current phone company you have?: </br>
             <input name="rptCustomization$ctl07$rptItems$ctl01$ctrl" type="text" maxlength="100" id="rptCustomization_rptItems_7_ctrl_1" keep-current-customization="false" /></br>
             <br />
        </div>
    </div>

    <div class="textgrid">
         <div class="feildset1">
              What is the account # with your current provider?: </br>
              <input name="rptCustomization$ctl07$rptItems$ctl02$ctrl" type="text" maxlength="100" id="rptCustomization_rptItems_7_ctrl_2" keep-current-customization="false" /></br>
              <br />
         </div>
    </div>

    <div class="textgrid">
         <div class="feildset1">
              What is the PIN/access code for current provider?: </br>
              <input name="rptCustomization$ctl07$rptItems$ctl03$ctrl" type="text" maxlength="100" id="rptCustomization_rptItems_7_ctrl_3" keep-current-customization="false" /></br>
              <br />
         </div>
     </div>

     <div class="textgrid">
          <div class="feildset1">
               What are the two nearest cross streets?: </br>
               <input name="rptCustomization$ctl07$rptItems$ctl04$ctrl" type="text" maxlength="100" id="rptCustomization_rptItems_7_ctrl_4" keep-current-customization="false" /></br>
               <br />
           </div>
     </div>
当前运营商调查问卷
要保留您当前的家庭电话号码,请填写以下内容。

您当前电话账单上的帐户持有人姓名?:


您目前拥有的电话公司是:


您在当前提供商的账户是什么?:


当前提供商的PIN/访问代码是什么?:


最近的两个十字路口是什么


试试这个:

$("input[keep-current-customization='false']").hide();
试试这个:

$("input[keep-current-customization='false']").hide();
在这种情况下,选择元素不需要attr()函数

在这种情况下,选择元素不需要attr()函数。

attr()函数设置或获取给定元素的属性值。要查找具有特定属性值的元素,请尝试以下操作:

$("input[keep-current-customization='false']").hide();
函数的作用是:设置或获取给定元素的属性值。要查找具有特定属性值的元素,请尝试以下操作:

$("input[keep-current-customization='false']").hide();

不要将
.attr
放在示例中:

example("input[keep-current-customization='false']").hide();

不要将
.attr
放在示例中:

example("input[keep-current-customization='false']").hide();

这是可行的,但我需要删除id为textgrid的div,它确实包含属性keep current customization=false。在这种情况下,我需要做什么?您可以使用has()选择器进行额外过滤,例如“div:has(input[keep current customization=false])选择所有带输入的div。然后隐藏这些div。这可以工作,但我需要删除id为textgrid的div,它确实包含属性keep current customization=false。在这种情况下,我需要做什么?您可以使用has()选择器进行额外过滤,例如“div:has(input[keep current customization=false])选择带有输入的所有div。然后隐藏这些div。这也可以,但我需要删除id为textgrid的div,其中包含属性为keep current customization=false的输入标记。在这种情况下,我需要做什么?这样做:例如(“.textgrid”).has(“input[keep current customization='false']”。hide();除非使用哈希符号而不是句点,因为它是一个ID而不是一个字符class@pwdst我看到了一个类,但可能我需要Glasses。OP在后续规范中弄错了,它确实是代码示例中的一个类。在屏幕不动产有限的平板电脑上使用StackOverflow,因此没有发现他们的错误-抱歉。这也可以,但我需要删除id为textgrid的div,其中包含属性为keep current customization=false的输入标记。在这种情况下我需要做什么?这样做:示例(“.textgrid”)。has(“输入[保持当前自定义设置=”假“]”。隐藏();除非使用哈希符号而不是句点,因为它是ID而不是class@pwdst我看到一个类,但可能我需要玻璃。OP在后续规范中弄错了,它确实是代码示例中的一个类。在屏幕空间有限的平板电脑上使用StackOverflow,因此没有发现他们的错误-抱歉。