I am trying to make a simple JavaScript script where a random word is chosen from an array and then the letters are randomly re-arranged; similar to an anagram. I've tried using .split(); on the word and then using a for loop to randomly show the letters but it doesn't seem to be working. For example:
for (var i = 0; i < splitWord.length; i++) {
var randomLetter = Math.floor(Math.random() * splitWord.length);
alert(randomLetter + '<br />');
}
Most, if not all, of the questions that I found appear to be asking how to create a script to solve anagrams rather than actually creating them.
Fiddle: http://jsfiddle.net/TnT2x/