Changing background image using jquery
I have this jquery code that changes the image of the background on click: $('a.note').click(function(){ $('#full').css('background-image','img/1.jpg'); }); However, it's not changing. Is there something I'm missing? You need to include the url() part of the background-image property. $('#full').css('background-image','url(img/1.jpg)'); 来源: https://stackoverflow.com/questions/4578714/changing-background-image-using-jquery