Joao Paulo
Joao Paulo

Reputation: 1103

Jquery Script not working in Internet Explorer

I have this script working fine in Chrome but in IE 8 or 9, this code is not working:

$(document).on("mousedown", '#CentroCusto_new option', function (event) {
    debugger;
    alert('oi');
    event.returnValue = false;
    this.selected = !this.selected;
    event.preventDefault();
});

How to solve this? I think IE is not accepting this selector, but why?

JSFIDDLE

Upvotes: 2

Views: 265

Answers (1)

Matt Chepeleff
Matt Chepeleff

Reputation: 419

debugger; is pausing execution of your code - which is why alert() isn't firing

Upvotes: 1

Related Questions