Clickable label not working in IE 8

后端 未结 9 2102
Happy的楠姐
Happy的楠姐 2020-12-14 01:47

I\'ve got the following list item:

  • 9条回答
    •  时光说笑
      2020-12-14 02:18

      This works for me with a group of radio inputs followed by labels containing an image. Basically used it instead of using for attribute in all browsers

            inputs.each(function() {
      
               $(this).click(function (e) {
                   // do stuff ...
               });
      
              // adding click handler to label containing image 
              $(this).next().on('click', function(event) {
                  // prevent 'for' attribute firing
                  event.preventDefault();
                  // check and trigger click on input
                  $(this).prev().prop("checked", true).trigger('click');
              });
           });
      

    提交回复
    热议问题