报错解决:Uncaught ReferenceError: Invalid left-hand side in assignment

Error resolution:
Screenshot of Uncaught ReferenceError: Invalid left-hand side in assignment error report:
Insert picture description here

Translated as: the left side of the assignment is invalid

Reason: modify the attribute of background-color in javaScript

Error code: This code is written inside the javaScript, I use CSS styles to the background-color, but the script language does not support the use of "-" to name, so the error, the correct wording should be used directly hump nomenclature , To use the background-color property.
hid.style.background-color = "#ddd";
hid.style.backgroundColor = "#ddd";

Guess you like

Origin blog.csdn.net/qq_38960155/article/details/109246058