title: Generate random number that is not in array
body: <p>Hope I can explain well.</p>
  
  <p>So I have 8 boxes with class .boxA with a numeric value generated from js:</p>
  
  <pre><code>&lt;div class="tfooter"&gt;
      &lt;div class="boxA" id="bx3" value="3"&gt;3&lt;/div&gt;
      &lt;div class="boxA" id="bx27" value="27"&gt;27&lt;/div&gt;
      &lt;div class="boxA" id="bx46" value="46"&gt;46&lt;/div&gt;
      &lt;div class="boxA" id="bx40" value="40"&gt;40&lt;/div&gt;
      &lt;div class="boxA" id="bx42" value="42"&gt;42&lt;/div&gt;
      &lt;div class="boxA" id="bx29" value="29"&gt;29&lt;/div&gt;
      &lt;div class="boxA" id="bx13" value="13"&gt;13&lt;/div&gt;
      &lt;div class="boxA" id="bx1" value="1"&gt;1&lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>First of all I push all values in a array:</p>
  
  <pre><code>var randomnumber = Math.ceil(Math.random()*50);
  var array = [];
  $(".boxA").each(function(){
      var dNumber = $(this).attr('value');
      array.push(dNumber);
  });
  </code></pre>
  
  <p>Each of this boxes contain a random number from 1 to 50.</p>
  
  <p>Now, I want to generate another random number and check if exists in the array. If exists, generate another number until it's unique in that array. When is unique, create another div.</p>
  
  <p>I've tryed with indexOf, with inArray, with while, but I can't get it working. The problem is that generate. Generate new number until not in array.</p>
  
  <p>Thank you very much!</p>