Hide function not working in jQuery

I’m trying to create a dynamic popup where, of various elements placed on a single popup, The default is that the entire popup with all elements show up. The code is supposed to make only one element show and the others get hidden, depending on which button gets clicked. But it’s not working as intended.

Code as below :

<script>
$(document).ready(function(){
  $('.pop-rows').hide();
	$('.pop-01').show();
    $('.btn-pop').on('click',function(event){
		event.preventDefault();
		event.stopPropagation();
		  $('.pop-rows').hide();
		  href = $(this).attr('href').substring(8);
		  $(href).show();
	$('.btn-popup').trigger('click');
	});
});
</script>

WHat could be the problem here?

you didnt post any visible code

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.