title: How to get random elements from an array
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/4550505/javascript-getting-random-value-from-an-array">JavaScript: Getting random value from an array</a>  </p>
  </blockquote>
  
  
  
  <pre><code>var numbers = new Array('1','2','4','5','6','7','8','9','10');
  </code></pre>
  
  <p>I have a JavaScript Array and now want to randomly choose four different numbers from it and then express it on the page (through <code>document.write</code>). Obviously each time the page is reloaded by the user it would show four different random numbers.</p>