I feel like this might be a stupid question. I am trying to make the background image of a div change based on whatever object is selected.
`
previewBackground.style.backgroundImage = "url(`/images/object.firstName}.png`)";
`
I need to escape the doubles quotes for the URL to fill in the object.firstName property. Can someone help me with the syntax here?
I have tried using single quotes of the URL, as well as . Single quotes don't do the trick, and
turn my entire escape my entire URL.
I have also tried a \ but this only affects the following character and feel like there has to be a more efficient way to do this.
Thanks! I am pretty new to JS.