How do i do this? to put variable in a background

How do i do this? to put variable in a background

Hi!

I did this code to put an array variable in this code below

 $('#principal').css({"background":"url(../copiaproj/imagem/img1.jpg) no-repeat"});

I did this form, but it did not work

 $('#principal').css({"background":"url("' + array[index] + '") no-repeat"});

How do i do this to work?