<style> .screenpage { display: none; } .show { display: block } </style> <script src="/scripts/snippet-javascript-console.min.js?v=1"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 1 close 2 close 3 close 4 close 5 close 6 close 7 close 8 close 9 close 10 close <script type="text/javascript"> $('.close').click(function() { $('.screenpage:visible').hide().siblings().eq(Math.floor(Math.random() * 9)).show(); }); </script>