Answers for "if else condition on hide and show in jquery"

0

if else condition on hide and show in jquery

<script type="text/javascript">
  $(document).ready(function(){ 
    $(".fil-cat").click(function(){
      var val = $(this).attr('id');
      if(val == 'allCat'){
        $('.main-card').show();
      }else {
        $('.main-card').hide();
        $('.'+ val).show();
      }
      
    });
   });
</script>
Posted by: Guest on January-27-2021

Code answers related to "if else condition on hide and show in jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language