Every element in a HTML document is also a Javascript object. Most elements have a style property that contains the CSS properties. The background colour can be set with element.style.background. The foreground colour is controlled by the value of element.style.color.

Multiple word CSS properties (words separated by hyphens) are converted to Javascript identifiers where the individual words are capitalized. The CCS property font-family is fontFamily. The border-left-width property is accessed with borderLeftWidth in Javascript.