Answers for "js random color that is really different"

9

javascript random color

'#'+(0x1000000+(Math.random())*0xffffff).toString(16).substr(1,6)
Posted by: Guest on February-28-2020
0

generate random color jquery

$("#btn").click(() => {
  var colorCode = "1234567890abcdef";
  var color = "";
  for (var i = 0; i < 6; i++) {
    color += colorCode.charAt(Math.floor(Math.random() * colorCode.length));
  }
  $("#hex").html("HEX: " + "#" + color); //Display hexacode
  $("#displaycolor").css("background", "#" + color); //Display color
});
Posted by: Guest on November-30-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language