当前位置: 动力学知识库 > 问答 > 编程问答 >

html - jquery .hide() and show() not working in IE

问题描述:

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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: