I have this script that once clicking a button will generate a random number between 0 and 13. However I'd like to add some kind of animation so when the button is clicked it looks like it's working each time. Such as flashing other random numbers each time before settling on it's final number, simular to dice. The javascript code I have so far just to generate the random number is this;
function newNumber() {
var x = Math.floor((Math.random() * 14) + 0);
document.getElementById("number").innerHTML = x;
}
what would be the best way to go about this?
much like this example: http://jsfiddle.net/ZDsMa/1/ but obviously not as broken as that