'jQuery not working on IE11 but working on Chrome, Firefox and Edge?

My scripts are working fine on all other browsers EXCEPT IE11. For example

jQuery('#btnblacklist').click(function(){
    jQuery('#popUpBlackList').css("display","block");
    jQuery('.cover').css('display','block');
});

is not returning anything on IE11. Even Microsoft Edge is okay with it.

I have already called the script in my header.

<script type="text/javascript" src="//cdn.jsdelivr.net/jquery/1/jquery.min.js"></script>

Any idea?



Solution 1:[1]

Try this solution, you need to wrap our code in a .ready function.

$(document).ready(function () {
    jQuery('#btnblacklist').click(function () {
        jQuery('#popUpBlackList').css("display", "block");
        jQuery('.cover').css('display', 'block');
    });
});

So you're code will start to run when the document is finished loading.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ngeksyo