element = document.querySelector("div"); element.style.backgroundColor = "#242424";
The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.