Show posts onclick

Hey guys it’s been many hours im looking for this. I hope you can help me

I want to show random post if a visitors clicks a button. This is my code so far that actually works fine

<div class="random_posts" onclick="javascript:_gaq.push(['_trackSocial', 'Footer', 'Random']);">
<?php $posts = get_posts('orderby=rand&numberposts=6'); foreach($posts as $post) { ?>
<li><div class="relatedthumb"><a href="<? the_permalink()?>" rel="bookmark" title="<?php the_title(); ?>"><?php the_post_thumbnail( 'Related-Thumb' ); ?><?php the_title(); ?></a></div></li>
<?php  wp_reset_query(); ?>
<?php } ?>