title: convert decimal to hex in table
body: <p>I am trying to create a table similar to this one: </p>
  
  <p><a href="https://i.stack.imgur.com/gf8Ef.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/gf8Ef.png" alt="I want something similar to this"></a></p>
  
  <p>I uploaded the site so it can be viewed here: <a href="http://alainwebdesign.ca/CIS245/rgb.html" rel="nofollow noreferrer">http://alainwebdesign.ca/CIS245/rgb.html</a></p>
  
  <p>In the script file, I was trying to populate the "<em>Red Hex</em>" column by modifying the <code>generateRandomReds()</code> function like so: </p>
  
  <pre><code>function generateRandomReds(){
       for(var i=0; i&lt;11; i++){
      var randRed = Math.random();
      randRed = randRed.toFixed(2);
  
        var sel = document.getElementById('genRandomReds');
        var opt = document.createElement('option');
        opt.innerHTML = randRed;
        opt.value = randRed;
        sel.appendChild(opt);
  
        //Trying to convert decimal to hex and populate the "Red Hex" 
        //column in the Generate random colors table
        //but for some reason adding this code makes it so only 1 random 
        //red decimal value is created and that's it:
  
        var selHex = document.getElementById('genRedHex');
        var optHex = document.createElement('option');
        optHex.innerHTML = randRed(parseInt( number , 10)).toString(16);
        optHex.value = randRed(parseInt( number , 10)).toString(16);
        selHex.appendChild(optHex);
        }
  }
  </code></pre>