Show Random Message on Page Refresh

Posted by Lakhangarg under JavaScript category on | Views : 2066
Place all the Messages in an Array
Math.floor(Math.random() * 8) function will pick the random record from array.

<script language="JavaScript" type="text/javascript">
var arMessage = new Array(
'She is a complete waste of space',
'I did not recognize you with your clothes on ',
'If I never see you again, it will be too soon ',
'He is so full of shit, even his eyes are brown',
'You are so far up our managers ass, I can almost see your legs',
'She is as welcome as a turd in a swimmingpool',
'My boss is an accident waiting for a place to happen',
'I would not piss on you, even when you were on fire');
var ind = Math.floor(Math.random() * 8);
document.write('<b class="r">'+arMessage[ind]+'</b>');

Thanks & Regards
Lakhan Pal Garg

Comments or Responses

Login to post response