Select a random string from an array
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/4550505/javascript-getting-random-value-from-an-array">JavaScript: Getting random value from an array</a>  </p>
</blockquote>



<p>Could someone help me on this topic? I've got this code.</p>

<pre><code>var textArray = [
    'song1.ogg',
    'song2.ogg'
]
audioElement.setAttribute('src', textArray);
</code></pre>

<p>How can I randomly get one of those strings into my audio element?</p>

<p>Would be glad if someone can help....</p>
