I\'m having a problem with Javascript. It\'s almost certainly something I\'m doing wrong as I\'m quite new to js. I\'m trying to modify a div tag\'s z-index to 1 from -1 so an i
When addressing CSS properties in javascript, anything that has a hyphen is transformed to camel case. Try this instead:
document.getElementById("img-bubble1").style.zIndex = "1";
Related Q/A
Edit: Additional information for posterity, as said by khanahk in a comment, a hyphen in a variable name will be interpreted as a minus sign, and this is not valid assignment syntax. An interesting and not recommended way around this is to use bracket notation instead:
document.getElementById("img-bubble1").style["z-index"] = "1";