私はこのブロックを隠すためにこのコードを持っています。表示をクリックすると、すべてのブロックが表示されます。どうすれば修正できますか?show hideブロックを固定する
$(document).ready(function(){
$("#hide").click(function(){$(".block").hide();});
$("#show").click(function(){$(".block").show();});
});
.block{background: grey; width: 350px; height: 50px;}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div>
<button id="show">Show</button>
<div class="block">If you click on the "Hide" button, I will disappear.</div>
<button id="hide">Hide</button>
</div>
<div>
<button id="show">Show</button>
<div class="block">If you click on the "Hide" button, I will disappear.</div>
<button id="hide">Hide</button>
</div>
みんなありがとう!私は私の質問を解決した –