In this example Chrome sets the background red, firefox and IE do not.
Trying:
document.getElementById("firefoxDiv").style['backgroundColor'] = "Red";
and
document.getElementById("firefoxDiv").style['background-color'] = "Red";
I would much rather be able to use the same syntax used in external CSS
background-color vs inline using javascript .style.backgroundColor =
Thanks for your help!
Note: NO jQuery please.
Use
.style.setProperty(propertyName, value [, priority])instead of an expando property.Example: