Currently, I am attempting to create a random border color within a div using specific hex codes that have already been determined, but I am encountering some difficulties.
Does anyone have any suggestions on how to achieve this? I am still learning JavaScript and the code I have been using is not producing the desired outcome.
document.addEventListener('DOMContentLoaded', function() {
var randomNumber = Math.floor(Math.random() * 4);
var id = ['e789ad', '1cfeff', 'ffffff', 'ffffff', '363877'];
console.log(randomNumber);
document.querySelector("div.menu").style.borderColor = "#" + id[randomNumber.length] + ";";
});