Javascript style variables with "-" in their name aren't able to be changed? -


OK, so this bug took me a lot of time and embarrassed it seems that with any style variable - in it His name can not be modified by javascript.

As seen here:

  & lt ;! DOCTYPE html & gt; & Lt; Html lang = "en" & gt; & Lt; Top & gt; & Lt; Title & gt; Classroom test & lt; / Title & gt; & Lt; Meta charset = "UTF-8" /> & Lt; Style & gt; Body {text-line: center; Background color: #ffffff;} # box {status: complete; Left: 610px; Top: 80px; Height: 50px; Width: 50px; Background color: # FF0000; Color: # 000000;} & lt; / Style & gt; & Lt; Script type = "text / javascript" & gt; Var box = 0; & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div id = "box" & gt; & Lt; / Div & gt; & Lt; Script type = "text / javascript" & gt; Box = document.getElementById ('box'); Box.style.background-color = "# 0000ff"; & Lt; / Script & gt; & Lt; / Body & gt; & Lt; / Html & gt; In the example said the box will be left just in the box.  

So how can I change a style variable with that name?

background color , camelcase.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -