title: Add class to random li in all ul's
body: <pre><code>&lt;div id="question-1" name="question" 
      &lt;ul&gt;  
          &lt;li name="347815" class="MULTIPLE" id="7548094" value="7548094"&gt;1&lt;/li&gt;
          &lt;li name="347815" class="MULTIPLE" id="7548095" value="7548095"&gt;2&lt;/li&gt;
          &lt;li name="347815" class="MULTIPLE" id="7548096" value="7548096"&gt;3&lt;/li&gt;
          &lt;li name="347815" class="MULTIPLE" id="7548097" value="7548097"&gt;4&lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  
  &lt;div id="question-2" name="question" 
      &lt;ul&gt; 
          &lt;li name="347818" class="MULTIPLE" id="7548140" value="7548140"&gt;1&lt;/li&gt;
          &lt;li name="347818" class="MULTIPLE" id="7548143" value="7548143"&gt;2&lt;/li&gt;
          &lt;li name="347818" class="MULTIPLE" id="7548168" value="7548168"&gt;Hemköp&lt;/li&gt;
          &lt;li name="347818" class="MULTIPLE" id="7548169" value="7548169"&gt;3&lt;/li&gt;
          &lt;li name="347818" class="MULTIPLE" id="7548184" value="7548184"&gt;4&lt;/li&gt;
          &lt;li name="347818" class="MULTIPLE" id="7548195" value="7548195"&gt;5&lt;/li&gt;
          &lt;li name="347818" class="MULTIPLE" id="7548208" value="7548208"&gt;6&lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>I need a js "jquery" code to select a random li element from all ul lists. The list number changes constantly so I need to use something like .find(); </p>
  
  <p>This is the code that I have right no but it doesn't select one li in all ul, it selects random li in random ul:</p>
  
  <pre><code>var list = $('ul &gt; li');
  list.eq(parseInt(Math.random()*list.length)).addClass('selected');
  </code></pre>
  
  <p>Thank you guys :)</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>@MTCoster has the right answer, here is it:</p>
  
  <p><code>$("ul").each(function() {
    var liArr = $(this).children("li");
    $(liArr[Math.floor(Math.random() * liArr.length)]).addClass('selected');
  });</code></p>