JavaScript define cores em hexadecimal

element = document.querySelector("div");
element.style.backgroundColor = "#242424";
Glamorous Gull