I have a problem with my jQuery code, I use "show" and "hide" buttons to display/hide the class, but jQuery only works with my first class. My code is:
$(document).ready(function(){
$("#hide").click(function(){
$(".menu_sub_index").hide(500);
});
$("#show").click(function(){
$(".menu_sub_index").show(500);
});
});
<div class="danhmuc">
<button id="hide">⛔</button>
<button id="show">Category</button>
</div>
Any suggestions to improve my code? Thanks!