Script is not working in IE

8

I'm using this script in Chrome and it works fine. But IE 8 or 9 does not work. I put a debugger and an alert to debug, but it does not even enter the function.

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

Does anyone know why and how to fix it?

JSFiddle

    
asked by anonymous 12.03.2014 / 21:41

3 answers

0

IE really does not let you understand the selection through the option.

    
17.03.2014 / 17:48
7

Following the comment I left on your question yesterday

14.03.2014 / 00:44
0

Does this work?

    jQuery("#CentroCusto_new option").on('click', function (event) {
        event.preventDefault();
        alert('oi');
        this.selected = !this.selected;
        return false;
    });

or something like that?

$( ".target" ).change(function() {
alert( "Handler for .change() called." ); 
});

link

    
12.03.2014 / 23:32