In jquery, how can I set the background-image of an element without
hardcoding the url of the image in my javascript?
I have an image element that I can reference by its class and/or id and I
have a div. I want to set the background-image of the div to the image
element, but I don't want to hardcode the url path in my JavaScript code.
How can I do this? I saw lots of answers to this but they all hardcoded
the url in the JavaScript code.
No comments:
Post a Comment