JQuery Clicking / changing an event does not work properly in IE7 / 8

I bind an event to a check box change or click event, which works fine in Firefox, but in IE I need to click elsewhere (causing blur) before the event fires.

I have read and believe that this is due to how IE fires events, but can I get around it anyway ?!

The thing is that this is a smooth search function that does not require a search button

$('#sidebar .itemSearchModule-Form input[type=checkbox]').click(function() {
    $('#sidebar .itemSearchModule-Form .saveButton').click();
});
+3
source share
3 answers

A change event requires blurring first. The Click event should not. You can always force an event blurif you want,$(elem).blur()

+1

, .

, , , .

CLICK IE, , , ,

+1

try to assign a class like to this flag chkbxand try:

$('.chkbx').click(function() { etc...

its just for debugging your selector. Verify that the problem is in action. I think for IE you need to use GetElementByID.

0
source

Source: https://habr.com/ru/post/1720700/


All Articles