I'm not sure if this is what you want but have a look at this Codepen! It changes color of input box randomly. Here's the HTML Below:
<div style="height:150px">
<h1>Type in the Input BOX below and see changing colors as you type!!</h1>
<br><br>
<input type="text" id="multi" style="width:100%; height:100px; font-size:26px;" onkeydown="myFunction()">
</div>
Here's is JS:
var myArray = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'];
function myFunction(){
var rand = myArray[Math.round(Math.random() * (myArray.length - 1))];
var rand1 = myArray[Math.round(Math.random() * (myArray.length - 1))];
var rand2 = myArray[Math.round(Math.random() * (myArray.length - 1))];
var rand3 = myArray[Math.round(Math.random() * (myArray.length - 1))];
var rand4 = myArray[Math.round(Math.random() * (myArray.length - 1))];
var rand5 = myArray[Math.round(Math.random() * (myArray.length - 1))];
document.getElementById("multi").style.color = '#'+rand+rand1+rand2+rand3+rand4+rand5;
}
P.S. I'm new to java script but i tried helping!