问题描述:

I have IE 11 and when i try this code, it works in firefox and chrome but not in IE, is there any workaround?

<!DOCTYPE html>

<html>

<head>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"> </script>

<script>

$(document).ready(function(){

$(".btn1").click(function(){

$("p").hide();

});

$(".btn2").click(function(){

$("p").show();

});

});

</script>

</head>

<body>

<p>This is a paragraph.</p>

<button class="btn1">Hide</button>

<button class="btn2">Show</button>

</body>

</html>

网友答案:

I've checked your script in multiple versions of IE and the script is even working in old versions like IE 5.

Like mentioned earlier by some others, make sure IE isn't blocking external files.

相关阅读:
Top