Possible Duplicate:
JavaScript: Getting random value from an array
Could someone help me on this topic? I've got this code.
var textArray = [
'song1.ogg',
'song2.ogg'
]
audioElement.setAttribute('src', textArray);
How can I randomly get one of those strings into my audio element?
Would be glad if someone can help....