title: how to exclude individual numbers from math.random
body: <p>I need jquery to make an array, which includes only the numbers, that are selected with checkboxes. In other words I need <code>math.random</code> to exclude answers that arent checked. There will be more checkboxes, when I get over this problem</p>
  
  <pre><code>if ($('#check1') .is(':checked')) {
      var nrI = "1";
  } else {
      var nrI = "";
  }
  if ($('#check2').is(':checked')) {
      var nrII = "2";
  } else {
      var nrII = "";
  } 
  
  var numbrid = [nrI,nrII];
  
  if (nrI + nrII == 0) {
      var numRand = Math.floor((Math.random()*2)+1);
  } else {
      var numRand = Math.floor((Math.random()*numbrid.length)+1);
  }   
  $("#number") .text(numRand);
  </code></pre>