I'm trying to add a CSS background image with jQuery but can't seem to figure out how. I THINK I'm along the right lines but I'm not sure...
var bgImg = "http://www.domain.com/my-image.jpg";
$('#myBanner').css("background", "url("+bgImg+");");
Here's a fiddle of it not working: http://jsfiddle.net/qLqvtkp3/
Any help would be great!!
;in the string