Q:

Can't access CSS some style fields from javascript

Is there a reason why I can do this:
document.getElementById('gridID').style.background='blue';

but when I try this:
document.getElementById('gridID').style.background-color='blue';

throws this:
 Uncaught ReferenceError: Invalid left-hand side in assignment

I need to access backgroundPosition and some other things and they just aren't working. They do not appear in xcode's autosuggest when I type and they do not work when I try them anyways. Any thoughts? I haven't found similar problems on Google to my surprise.
Thanks,
Chet.

A:

Javascript identifiers cannot contain -s.
Instead, use camelCase:
document.getElementById('gridID').style.backgroundColor='blue';

