title: many divs with same class - different background
body: <p>so i have many divs with same class on the same page. i would like to add different backgrounds for each of them on my own choise(having 5-6 random backgrounds)</p>
  
  <p>i found this code on the internet. but it chooses the same random color for all the divs. </p>
  
  <pre><code> &lt;script type="text/javascript"&gt;
  
  /***********************************************
  * Random Content Colors script- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
  * This notice MUST stay intact for legal use
  * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
  ***********************************************/
  
  //specify list of random background colors to apply to CSS class "randomcolor"
  //For each entry, you can optionally specify a text and link color via the syntax:
  // "BackgroundColor:TextColor" OR "BackgroundColor:TextColor:LinkColor"
  var randombgcolors=["green:white:yellow", "#DDF4FF", "#FFFF97", "#CFFF9F"]
  
  var rbcssrule=""
  var randomnum=Math.floor(Math.random()*randombgcolors.length)
  if (randombgcolors[randomnum].indexOf(":")!=-1){
  rbcssrule="background-color: "+randombgcolors[randomnum].split(":")[0]+";"
  rbcssrule+="color: "+randombgcolors[randomnum].split(":")[1]+";"
  }
  else
  rbcssrule="background-color: "+randombgcolors[randomnum]+";"
  
  document.write('&lt;style type="text/css"&gt;\n')
  document.write('.randomcolor{'+rbcssrule+'}\n')
  if (randombgcolors[randomnum].split(":").length==3) //if link color specified
  document.write('.randomcolor a{color:'+randombgcolors[randomnum].split(":")[2]+';}\n')
  document.write('&lt;\/style&gt;')
  
  &lt;/script&gt;
  </code></pre>