Name Mon Lu

Love jQuery/CSS

Blog about Webdev

Twitter supawaza

RSS Twitter Flickr

What I am up to:


Posts Tagged ‘random number’

Quickie note, a very sim­ple script to pick a ran­dom num­ber between 1–5, instead of 0–4

	var rand = Math.floor(Math.random()*5);
	if(rand > 0){
		rand = rand+1;
		alert(rand);
	} else {
		rand = 1;
		alert(rand);
	}