title: Using jQuery to choose two grids randomly in my table
body: <p>I am trying to append <code>enemy_1</code> and <code>enemy_2</code> in the <code>&lt;td&gt;</code> tags on my 6x7 table randomly. </p>
  
  <p>I don't know how to solve this with random method or any other way. </p>
  
  <pre><code>// target -&gt; all &lt;td&gt;
  $('table').find('td');
  
  // two individual enemies
  var enemy_1 = $('&lt;span&gt;enemy_1&lt;/span&gt;');
  var enemy_2 = $('&lt;span&gt;enemy_2&lt;/span&gt;');
  </code></pre>
  
  <p>here is my table</p>
  
  <pre><code>for (var i = 0; i &lt; 7; i++) {
      $("table").append("&lt;tr&gt;&lt;/tr&gt;");
  }
  
  for (var i = 0; i &lt; 6; i++) {
      $("table tr").append("&lt;td style='background:#DDDDDD;height:50px;width:50px;'&gt;&lt;/td&gt;");
  }
  
  $('table').prepend('&lt;div&gt;Start&lt;/div');
  $('table').append('&lt;div&gt;End&lt;/div');
  
  $('table div:last-child').css({
    position :'absolute',
    right: '0'
  });
  </code></pre>