Dusk
Dusk

Reputation: 2201

How to run click event handler in Internet Explorer 10 using jquery?

I'm trying to run click event handler using jquery 1.7 by clicking on anchor tag. This code is working fine in firefox, but I'm not able display alert box using same code in IE 10. Could anyone please tell me how to achieve this functionality in internet explorer 10?

$(document).ready(function() {
    $('.call-link').on('click', function (ev, evData) {
        alert("hello world");
    }); 
});

Upvotes: 3

Views: 783

Answers (3)

user3242956
user3242956

Reputation: 71

The expected behaviour in IE is that a button or link doesn't fire any events when it's disabled. Your link is disabled. So the event is not getting fired.

Upvotes: 1

Deep Sharma
Deep Sharma

Reputation: 3473

It is not calling in IE because the element is disabled.

see: Demo

$(document).ready(function() {
    $('.call-link').click(function (ev, evData) {
        alert("hello world");
    });
});

Upvotes: 6

Roy M J
Roy M J

Reputation: 6938

Try :

$(document).on('click', '.call-link', function (ev, evData) {
        alert("hello world");
}); 

Demo : http://jsbin.com/tucu/1/

Upvotes: 1

Related Questions