PDA

View Full Version : Ordering the number


nur
Oct 3, 2007, 02:27 AM
hi,

I have made an HTML page which shows a dice game.

but the only difficult thing is putting the random numbers in order from the highest to the lowest:(

I hope that you can answer my question

thank you

aaii
Oct 10, 2007, 11:11 AM
You would have to use JavaScript to do this.

Take a look at sort function (http://www.w3schools.com/jsref/jsref_sort.asp)

Then you would have to use the DOM to change (.innerHTML property) the elements data (such as using a DIV).

Hope that helps.