Element I want to change
<button id="thumb" onfocus="focus()" style="height: 12px; width: 12px; background-color: white; border-radius: 50%; margin: 0 auto; position: relative; top: -3px; left: 50%; box-shadow: 0px 0px 3px #888888;">
</button>
Function called:
function focus() {
document.getElementById('thumb').style.background-color="blue";
}
The error:
Uncaught ReferenceError: Invalid left-hand side in assignment
I don't understand why this is an error. I think it might be because of the - symbol. It works with other styling e.g. document.getElementById('thumb').style.width="10px" works.