javaScript set color in hex

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