title: How to randomly remove elements of same class using jquery
body: <p>I have about 72 divisions of class="box" </p>
  
  <p>these are some black colored boxes covering my whole pages, and i want to remove these divisions one by one and randomly after the completion of on of my function.</p>
  
  <p>Here is what i am doing to remove these boxes randomly,</p>
  
  <pre><code>function removeBoxes(){
  
      var erase;
              //var to store the length of array of divisions
      var total = $(".box").length;
      while(total &gt; 0)
      {
                //generating a random number
          erase = Math.floor(Math.random() * total);
          $(".box").eq(erase).fadeOut(10000, function(){
              $(this).remove();
          });
          total = $(".box").length;
      }
  }
  </code></pre>
  
  <p>Later i would also add some time delay between two removals, but for now i just want to know how to remove these boxes one by one.</p>