If, in JavaScript, you need to reference/manipulate CSS properties at runtime that contain a hyphen or dash in their names, omit the hyphen and, instead, camelcase the surrounding letters. You need to do this because hyphens in JavaScript variable names are illegal. For example, this won't work:

div.style.background-color = "red"; div.style.z-index = 3;

Whereas this will:

div.style.backgroundColor = "red"; div.style.zIndex = 3;

Hope this helps.