title: random no generate(1-9) using 9 <div> without no repitation,,,,,
body: <p>I have tried to generate rnadom number(1-9) in 9 div's. How to avoid number repitations? But it's not working, why i cant get output? Thanks in advance.
  Here is my code:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Random_No&lt;/title&gt;
  &lt;link rel="stylesheet" type="text/css" href="rno.css"&gt;
  &lt;script src="rno.js" &gt;&lt;/script&gt;
  &lt;/head&gt;
  
  &lt;body class="outer" onload=random()&gt;
  &lt;div id="input1" &gt;&lt;/div&gt;
  &lt;div id="input2" &gt;&lt;/div&gt;
  &lt;div id="input3" &gt;&lt;/div&gt;
  &lt;div id="input4" &gt;&lt;/div&gt;
  &lt;div id="input5" &gt;&lt;/div&gt;
  &lt;div id="input6" &gt;&lt;/div&gt;
  &lt;div id="input7" &gt;&lt;/div&gt;
  &lt;div id="input8" &gt;&lt;/div&gt;
  &lt;div id="input9" &gt;&lt;/div&gt;
  &lt;script&gt;
  function random()
  {
  var a=new Array("input1","input2","input3","input4","input5","input6","input7","input8","input9");
  x=a.length;
  var ran=new Array();
  for(var i=0;i&lt;x;i++)
  {
     ran[i]=Math.floor(Math.random()*9);
  }
  
  for(var i=0 ; i&lt;x ; i++)
  {
     document.getElementById("a[i]").innerHTML=ran[i];
  }
  }
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>