Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/38.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
jquery/css标签选择器在ie7中不工作_Jquery_Css - Fatal编程技术网

jquery/css标签选择器在ie7中不工作

jquery/css标签选择器在ie7中不工作,jquery,css,Jquery,Css,我有一些隐藏的单选按钮,当点击标签时被选中,但在ie7中,当点击标签时似乎没有选择单选按钮。为什么 jQuery('input[type="radio"]').on('change', function(){ if (jQuery(this).val()=='2') { jQuery("#user_type_3_wrapper label").removeClass(); jQuery("#user_type

我有一些隐藏的单选按钮,当点击标签时被选中,但在ie7中,当点击标签时似乎没有选择单选按钮。为什么

jQuery('input[type="radio"]').on('change', function(){
            if (jQuery(this).val()=='2') {
                jQuery("#user_type_3_wrapper label").removeClass();
                jQuery("#user_type_3_wrapper label i").hide();
                jQuery("#user_type_2_wrapper label i").show();
                jQuery("#user_type_2_wrapper label").addClass("active");
            } else {
                jQuery("#user_type_2_wrapper label").removeClass();
                jQuery("#user_type_2_wrapper label i").hide();
                jQuery("#user_type_3_wrapper label i").show();
                jQuery("#user_type_3_wrapper label").addClass("active");
            }
css

html

  • 作为主持人
    主持人是指希望举办活动或投标的人。
  • 作为参与者
    参与者是指希望参与活动或投标过程的人。
提前谢谢

您使用的有点错误,他们需要for属性,该属性包含他们所标记的radiobutton的id。文本需要在标签内,如下所示:

    <input type="radio" value="3" id="user_role_ids__3" />
    <label for="user_role_ids__3">as a <b>Participant</b></label>

作为参与者

您需要添加HTML以便我们可以看到标记。对不起,让我现在添加您是否使用不支持IE 6-8的jQuery 2.x版?不,它不是使用jQuery 2.x,而是使用1。*其他一切正常,只是似乎不是这样-我设法通过更改标签的css来修复ie8,使其不使用显示:没有,但ie7我仍然有一个问题,我通常不会错过这个问题!这是因为它都在ruby中,我不是一个ruby的家伙,所以没有发现它-谢谢!现在就试试吧哈哈,很好,对不起,我错过了!
<ul>
  <li class="input" id="user_type_2_wrapper">
    <label>
      <i class="icon icon-ok" style="display: none;"></i>
      <input type="radio" value="2" name="user[role_ids][]" id="user_role_ids__2"> as a <b>Host</b><br><span>A Host is the person who wants to run events or tenders.</span>
    </label>
  </li>
  <li class="input" id="user_type_3_wrapper">
    <label>
      <i class="icon icon-ok" style="display: none;"></i>
      <input type="radio" value="3" name="user[role_ids][]" id="user_role_ids__3"> as a <b>Participant</b><br><span>A Participant is someone who wants to take part in an event or tender process.</span>
     </label>
  </li>
</ul>
    <input type="radio" value="3" id="user_role_ids__3" />
    <label for="user_role_ids__3">as a <b>Participant</b></label>