Here is a function which works perfectly when I serve the background file name as bracketed string.(ie "my _image.png")
function mychoice_photo_show() {
document.getElementById('mychoice_photo').style.backgroundImage="url('my _image.png')"
}
HERE IS THE PROBLEM:-
function mychoice_photo_show(img) {
document.getElementById('mychoice_photo').style.backgroundImage="url(img)"
};
When I call it like so : mychoice_photo_show("my_image.png")
It does not call the requested image.
Should I look for any syntax like missing single quotes, or double quotes somewhere, or it just not supposed to work like that ?