skip to Main Content

Update the background image with jQuery

In jQuery, I'm trying to change the background image of a div: var USR_Settings_Color = $('.social-icons ul li a.active').css('background-image'); // Return : url("https://example.com/fir-DIY.jpg") After I update the like this: $('#preview').html('<div style="background-image: '+USR_Settings_Color+'"></div>'); But the result is like this: <div style="background-image:url("…

VIEW QUESTION
Back To Top
Search