I have a "show/hide div" function I have been working on. Everything is working well, except for the background image of the container div. I need this background image to change depending on the link a user clicks on.
So far I have this:
Code:
document.getElementById('cities_popup_container').style.backgroundImage = "url(images/locations_popup_box_oklahoma.png)" ;
I have a variable set up called "state". It value changes depending on what state someone clicks on. I need a way to change the "oklahoma" in my example above to be the value of the variable "state". I am sure this must be an easy fix, but I can't get it to work.
Thanks for any help!!
|